You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get the following errors when I enter any console commands in symfony 5.
In DebugCommand.php line 55:
Warning: count (): Parameters must be an array or an object that implements Countable
after debug I was able to determine that this is due to the contentful package.
In DebugCommand.php in line 55, "count" is used to check whether the entry of the "client-name" argument should be a mandatory field or an optional field. Php 7.4 doesn't like that :)
This happens if the contentful client is not initialized !!
# vendor\contentful\contentful-bundle\src\Command\Delivery\DebugCommand.php::__construct (line 55)$this->addArgument(
'client-name',
\count($this->clients) > 1 ? InputArgument::REQUIRED : InputArgument::OPTIONAL,
'The name of the client to use'
);
Would be great if you could improve that. A solution could look like this:
$this->addArgument(
'client-name',
!is_null($this->clients) && \count($this->clients) > 1 ? InputArgument::REQUIRED : InputArgument::OPTIONAL,
'The name of the client to use'
);
thanks for reporting this issue - and directly proposing a fix ;)
I'll integrate that in the next release. However, as I'm just taking over the maintenance of this repo at the moment, this might take a bit (I'd estimate ~2 weeks) - I hope this works for you. Thank you!
This commit avoids a warning when the library tries to call count() on a
non-array object. The issue is avoided by checking whether the object is
an array beforehand.
See #51
I've just implemented a fix for this. Would you mind checking out the version dev-issue-51 to check whether the fix works for you before I merge it into master?
Hey there,
I get the following errors when I enter any console commands in symfony 5.
In DebugCommand.php line 55:
Warning: count (): Parameters must be an array or an object that implements Countable
after debug I was able to determine that this is due to the contentful package.
In DebugCommand.php in line 55, "count" is used to check whether the entry of the "client-name" argument should be a mandatory field or an optional field. Php 7.4 doesn't like that :)
This happens if the contentful client is not initialized !!
Would be great if you could improve that. A solution could look like this:
Thanks in advance
greetings
Env:
php 7.4.10
symfony 5.2
contentful/contentful-bundle 6.1.0
The text was updated successfully, but these errors were encountered: