phpstan / phpstan-doctrine

Doctrine extensions for PHPStan
MIT License
598 stars 97 forks source link

Add phpdoc for transformation methods into other Collection stubs #622

Closed xificurk closed 4 weeks ago

xificurk commented 4 weeks ago

Fixes #621

This is basically the same road as Doctrine itself took - repeat the modified phpdoc in the child interfaces/classes.

ondrejmirtes commented 4 weeks ago

Please base it on top of 1.5.x (where the bug actually is and already released).

xificurk commented 4 weeks ago

Sorry, base changed...

I don't understand the failure on 7.4 and 8.0, it seems related to doctrine/collections 1.8.

xificurk commented 4 weeks ago

doctrine/collections 1.8 is the first version that got a extracted ReadableCollection interface, so Collection1.stub used for all 1.x versions is incorrectly inherting from ReadableCollection that exists only in 1.8.0. But I have no idea why the test is failing on that one version where it is actually a correct setup.

xificurk commented 4 weeks ago

Ah, I see, there is no Collection::map() in 1.8, it is inherited from ReadableCollection, so "incorrect" stub phpdoc is applied on this collections version.

Solved.

ondrejmirtes commented 4 weeks ago

Thank you!