-
Notifications
You must be signed in to change notification settings - Fork 229
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
sizeof(): Parameter must be an array or an object that implements Countable #79
Comments
Same issue here but changed condition from
|
I did the same as @MM-X and it worked. A cleaner solution would be to use
and
Thus, they are equivalent expressions. This solution has been requested on pull-request #84. |
@saqueib If possible, close the issue, as the solution has already been merged. Thanks. |
This issue is still occurring and has not been fixed in dev-master. |
Yes, issue has not been fixed in dev-master. I am currently using @MM-X 's suggestion as a temporary solution |
Still getting this error. |
How come this issue keeps getting close when it still occurs? |
It's merge in |
I did that @gabriel-cardoso, but now I'm getting the following error: |
Seems to fix it for us too, could you tag this? |
@iec989 you may need to run composer dump-autoload @mateusfccp late reply from me, I agree with your solution being better. Has this been merged yet? I read from the thread that it has been, but updating the package to dev-master, I get this strange error now
|
@MM-X I made a pull request and it has been merged. Some are complaining that it didn't work, though others are saying that it did work. There doesn't seem to be anything wrong with my code, and I don't think this error you are getting has nothing to do with my code (at least the error message doesn't imply it). Anyway, I don't know why some are not getting it to work. If you have any hint, please, comment here so we can solve it! |
@mateusfccp Do you confirm the merge was made on master? When I browse the repo and go to the Countries.php class I observe this at line 43
I have even tried removing the package from the project, deleted all files (migration + configs) reinstalled following the steps on the readme file, and now I am back to the error sizeof. Assuming this was not merged right on dev-master or on another branch as mentioned above?
|
Switching to dev-develop branch causes the same issue experienced by @iec989 |
@MM-X I merged on develop, as it can be seen here: I don't know if it should've been merged in another branch, for me it makes sense to merge to develop instead of master. |
Can we get this merged and tagged so the library doesn't break on > PHP 7? |
I was seeing this issue as well. @mateusfccp's |
bump |
1 similar comment
bump |
I am getting this error while seeding the countries
ErrorException: sizeof(): Parameter must be an array or an object that implements Countable in ../../vendor/webpatser/laravel-countries/src/Webpatser/Countries/Countries.php:43
If I remove the sizeof check it works.
initializing
protected $countries = [];
with empty array can fix it.I am running PHP 7.2
The text was updated successfully, but these errors were encountered: