-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
Make returntypes consistent with implementation #379
Make returntypes consistent with implementation #379
Conversation
I think what both Psalm and PHPStan are saying here is that you don't actually have a guarantee of that according to the annotations on |
I saw your toot about |
Would be great to support that in Github et al, yeah! But Inwanted to rebase that locally when I'm happy with it. Should have created a draft 🤦 |
I think, we're going to squash the PR in the end anyway. |
You can still click "convert to draft" after the PR is created 😉 |
To be squash merged or squashed. When squashing, I think we should apply the same changes I just applied to the title and description (apart maybe from the one with about using a Github keyword, as it only matters to Github). |
Oh and I think the target branch is wrong, it should be 2.2 since this is not a bugfix |
Note that this allows the behavior to match what we had in 1.7.0 (before extracting ReadableCollection) |
Ah yes… then forget about my comment, since it can be considered as a fix for a regression. |
The implementation of filter and map are working on a Collection and not on a ReadableCollection. Therefore they will also return a Collection and not a ReadableCollection.
24a2719
to
c21e2e1
Compare
All rebased and squashed so that it now is only one commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regression as in "not done on purpose in 2.0", even though the major version would allow such a change. But I don't expect much of a negative impact on this change/fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Should we apply this change to the partition()
method as well?
2.1.x bugfix release (patch) - Total issues resolved: **0** - Total pull requests resolved: **4** - Total contributors: **3** - [380: Improve return type for Collection::partition](#380) thanks to @heiglandreas - [379: Make returntypes consistent with implementation](#379) thanks to @heiglandreas - [377: Add doctrine-project.json to .gitattributes](#377) thanks to @VincentLanglet - [376: Doctrine Coding Standard 12](#376) thanks to @derrabus * tag '2.1.4': Improve return type for Collection::partition (#380) Make returntypes consistend with implementation (#379) Add doctrine-project.json to .gitattributes (#377) Doctrine Coding Standard 12 (#376)
The implementation of filter and map are working on a Collection and not on a ReadableCollection. Therefore they will also return a Collection and not just a ReadableCollection.
Closes #372