-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Milestone
Description
Bug report
I was trying to solve a PHPStan error in my code, where I had to remap a type of an optional array key.
I used if (isset($a['key'])) { ... } to catch the case and completely rewrite that value, but PHPStan still considers the "bad" value a possible type for key.
Code snippet that reproduces the problem
https://phpstan.org/r/c29618f1-5aa6-4295-b15f-b9382d014620
Expected output
I would expect no error, since string should no longer be a possible type after the if
Did PHPStan help you today? Did it make you happy in any way?
Totally! It's guiding me through a heavy refactoring!
Reactions are currently unavailable