-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Narrow existing return types on private/internal/final/test methods #42213
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nicolas-grekas
commented
Jul 21, 2021
728af74
to
a359552
Compare
(psalm issues are false positives, with a slight code improvement in ef84e66) |
Tobion
reviewed
Jul 21, 2021
src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/AnnotationsCacheWarmerTest.php
Outdated
Show resolved
Hide resolved
f08a602
to
97e8f39
Compare
PR is ready @symfony/mergers |
Tobion
reviewed
Aug 3, 2021
Tobion
reviewed
Aug 3, 2021
e302e94
to
b2de6c3
Compare
PR rebased and ready. |
nicolas-grekas
commented
Aug 9, 2021
src/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php
Outdated
Show resolved
Hide resolved
b2de6c3
to
4ff47df
Compare
4ff47df
to
d67a927
Compare
chalasr
approved these changes
Aug 9, 2021
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. I need to take a nap now 😅
derrabus
approved these changes
Aug 9, 2021
nicolas-grekas
added a commit
that referenced
this pull request
Aug 25, 2021
This PR was merged into the 6.0 branch. Discussion ---------- Add back ``@return` $this` annotations | Q | A | ------------- | --- | Branch? | 6.0 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - In #42213 I removed those annotations and tried to convinced myself and others that we could do so without loosing too much. I was about to send a PR to remove all remaining similar annotations. When I reviewed the patch I created for that, I stopped on `ItemInterface::tag()` (which is just an example): https://github.com/symfony/symfony/blob/444d43fa11990092c53ba54849bb1df36225adcf/src/Symfony/Contracts/Cache/ItemInterface.php#L52-L57 If we remove that annotation on the interface, all implementations will have to deal with the return value of the call to `tag()`. Whereas with ``@return` $this`, the contracts are clear: no need to, implementations are expected to mutate and return the current object. I don't think this would be appropriate in this example. /cc `@nikic` as this might be some nice food for thoughts to consider adding `$this` as a possible native return type. Commits ------- 7fafe83 Add back ``@return` $this` annotations
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
More progress from #42149