Open mr-feek opened 2 years ago
I found these snippets:
Possibly related to #6530.
Happy to take a stab at fixing this if someone would be so inclined to give some pointers :)
Cool! Did you check at my comment here: https://github.com/vimeo/psalm/issues/6530#issuecomment-926808964 ?
I analyzed that a while ago and I discovered it looks like an issue of "merging" the phantom_classes property between two context
Psalm.dev link: https://psalm.dev/r/273dd436a4
Expected Functionality: Psalm is aware that the class will exist within the conditional and does not emit an
UndefinedClass
errorNotes: Simply removing the
rand(0,1)
call results in expected behavior. An easy workaround for developers is to just put the class exists check on its own lineContext: Ran into this while doing composer package development for a library that has a
suggest
key in composer.json for additional functionality.