Skip to content

Add phpdoc for transformation methods into other Collection stubs #622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

xificurk
Copy link
Contributor

@xificurk xificurk commented Oct 29, 2024

Fixes #621

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

@xificurk xificurk force-pushed the fix-collection-transaformations branch from 00d6bd9 to 267a5ef Compare October 29, 2024 08:10
@ondrejmirtes
Copy link
Member

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

@xificurk xificurk changed the base branch from 2.0.x to 1.5.x October 29, 2024 08:27
@xificurk
Copy link
Contributor Author

Sorry, base changed...

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

@xificurk
Copy link
Contributor Author

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
Copy link
Contributor Author

xificurk commented Oct 29, 2024

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.

@xificurk xificurk force-pushed the fix-collection-transaformations branch from 47b044a to 65ab71e Compare October 29, 2024 09:11
@xificurk xificurk force-pushed the fix-collection-transaformations branch from 65ab71e to 0db7b22 Compare October 29, 2024 09:17
@ondrejmirtes ondrejmirtes merged commit 4e9c77f into phpstan:1.5.x Oct 29, 2024
44 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@xificurk xificurk deleted the fix-collection-transaformations branch October 30, 2024 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid map in collection.
2 participants