-
-
Notifications
You must be signed in to change notification settings - Fork 930
Open
Description
Bug report
Rector migrated our codebase and converted some closure to arrow functions.
PHPStan started to complain about invalid nullCoalesce usage.
When an array is reset (i.e. $var = []
), the type will go back to array{}
.
PHPStan seems to resolve the type to the original one when using a closure and the same as the parent scope when using an arrow function.
Sandbox with dumpedTypes : https://phpstan.org/r/99598551-bf43-46bb-acd5-57b104567c62
Code snippet that reproduces the problem
https://phpstan.org/r/a109bac9-6415-454e-a302-924c4a4c39e4
Expected output
Either the closure should complain as the arrow function or the arrow function should resolve the same type as the closure
Did PHPStan help you today? Did it make you happy in any way?
It save my life while doing big refactoring ❤️
Metadata
Metadata
Assignees
Labels
No labels