Phpstan: empty array, though it could not be empty

Created on 11 Mar 2019  路  3Comments  路  Source: phpstan/phpstan

Summary of a problem or a feature request

Since we updated to 0.11.3 today we got an error about an empty array passed to a foreach

Code snippet that reproduces the problem

https://phpstan.org/r/2d7f403b-7351-4874-9bda-bc824bbf0a24
Also see real world example: EntityWriter

The issue seems to be related to #1826 and #1882 Though I don't know if they are the exact same problem

bug

All 3 comments

Thank you, I'll look into that. This workaround works :) https://phpstan.org/r/6d5f0785-168e-46ba-aef9-bc77834c3c6c

thank you! :+1:

Was this page helpful?
0 / 5 - 0 ratings