Closed szepeviktor closed 3 years ago
Sorry @szepeviktor, that is a perfectly valid type in Psalm (which has a more powerful type system than PHPStan).
See how thanks to that annotation Psalm can find wrong types attached to a SplStorage:
https://psalm.dev/r/aae4b7470c
Okay. Suspected.
PHPStan has a generic stub for SplObjectStorage compatible with Psalm's so don't know what the issue here is: https://github.com/phpstan/phpstan-src/blob/master/stubs/SplObjectStorage.stub
Oh, I just noticed the SplObjectStorage stub wasn't registered, fixed: https://github.com/phpstan/phpstan-src/commit/143741c9c68edcc96845926b551d40eeed2af0d5
@ondrejmirtes Thank you.
Thanks for explaination @ondrejmirtes I guess it's a while I don't use PHPStan.
Can I ask you a question? The type system compatible with Psalm, is a separate implementation or you're using Psalm type system implementation somehow?
Psalm and PHPStan don't share any implementation details. To check out how PHPStan's typesystem is implemented, see: https://github.com/phpstan/phpstan-src/tree/master/src/Type
props. @phpstan