-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Fix inconsistent return points #33252
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
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
The fabbot.io errors can be ignored (it wants to fix the array syntax in the PHPUnit bridge). |
nicolas-grekas
approved these changes
Aug 20, 2019
365b0d7
to
f5b6ee9
Compare
Thank you @derrabus. |
nicolas-grekas
added a commit
that referenced
this pull request
Aug 20, 2019
This PR was merged into the 3.4 branch. Discussion ---------- Fix inconsistent return points | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #17201 in preparation for #33228 | License | MIT | Doc PR | N/A Inconsistent return points in methods prevent adding return types. I thought, I'll give it a try and fix them. After this PR, PhpStorm's inspection still finds 39 issues, but as far as I can tell, they're either false positives or fixture code. Commits ------- f5b6ee9 Fix inconsistent return points.
nicolas-grekas
added a commit
that referenced
this pull request
Aug 20, 2019
This PR was merged into the 4.3 branch. Discussion ---------- Fix inconsistent return points | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #17201 in preparation for #33228 | License | MIT | Doc PR | N/A That's #33252 on the 4.3 branch. Commits ------- c26c535 Fix inconsistent return points.
fabpot
added a commit
that referenced
this pull request
Nov 9, 2019
…ce::generate to remove null (shieldo) This PR was merged into the 3.4 branch. Discussion ---------- [Routing] revert the return type for UrlGeneratorInterface::generate to remove null …to remove null | Q | A | ------------- | --- | Branch? | 3.4 (only) | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT Bit of a casualty of commit tennis this: A change to add `null` here as an option for how `UrlGeneratorInterface::generate()` (rather than the concrete `UrlGenerator`) was merged in #28321, but then [reverted](90494c2) for the reason [that this could be seen as a BC break](#28321 (comment)), as the `null` return had not previously been documented (and is still not as part of the interface method docs). However, in a subsequent change (#33252) with a wider scope, this doc change was added _back_ in order to reflect the underlying implementation as a result of a PHPStorm plugin complaining. There's no indication though of what a `null` return here though would mean, and for the same reason as the first revert (that this should be seen as a BC break), I'd like to submit this to be reverted for the 3.4 branch. (In 4.4 the `null` has already been removed.) Having the interface indicating that this method can return `null` necessitates introducing a lot of actually redundant null checks in code that is covered by static analysis tools such as PHPStan. Commits ------- 9f853f3 [Routing] revert the return type for UrlGeneratorInterface::generate to remove null
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.
Inconsistent return points in methods prevent adding return types. I thought, I'll give it a try and fix them. After this PR, PhpStorm's inspection still finds 39 issues, but as far as I can tell, they're either false positives or fixture code.