-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
Description
Bug report
I ran into an issue where, if my variable is of a custom array-shape type and is nullable, PHPStan ignores the fact that a method ensures the variable is not null and raises an issue as if it could still be null when the variable is modified in place.
https://phpstan.org/r/308bb1cc-13b6-4e93-8c18-ef35289155ea
However, when it will be passed to another method it looks like phpstan knows that it cannot be null: https://phpstan.org/r/fde7bad2-54c0-430c-9ce6-1a22da5bd98f
Code snippet that reproduces the problem
https://phpstan.org/r/308bb1cc-13b6-4e93-8c18-ef35289155ea
Expected output
Assuring variable is not null is taken into account.
Did PHPStan help you today? Did it make you happy in any way?
No response
Metadata
Metadata
Assignees
Labels
No labels