-
-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 7.2: count(): Parameter must be an array or an object that implements Countable #688
Comments
This issue is not related to PHP 7.2 and neither to yiisoft/yii#4167. The error is thrown because of some wrong syntax in In this case the solution is to throw an exception in |
(Link to yii was just to give another case of the problem in another case) So if it's false, an error have to be thrown ? |
yes. there is no right "default" behavior the lib could do except of throwing an error. |
I don't know, it's supposed to throw an error if the node is empty ? Isn't it a problem of code logic or content ? |
Do not know it the error was thrown for that reason... I think the error was in |
After a short discussion, I think @goetas decided that if the xpath function return false ($nodes is the xpath return) then an exception have to be thrown. |
There's no contributing guide in this repo, I would like to help on this one but I need something to follow |
You have created the ticker in the wrong repo :) (that's why I have added the "serializer issue" label) The ticket should have been opened on https://github.com/schmittjoh/serializer. |
Please note that most likely you will have to submit your PR to the |
Similar to this issue : yiisoft/yii#4167
The default behaviour of count changed, it now fire a warning. It happen for example here : https://github.com/schmittjoh/serializer/blob/1.x/src/JMS/Serializer/XmlDeserializationVisitor.php#L179
Or whatever condition we choose, to keep the default Serializer behaviour the check is needed
The text was updated successfully, but these errors were encountered: