Skip to content

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 1 commit into from
Aug 20, 2019
Merged

Conversation

derrabus
Copy link
Member

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.

@derrabus
Copy link
Member Author

The fabbot.io errors can be ignored (it wants to fix the array syntax in the PHPUnit bridge).

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Aug 20, 2019
@nicolas-grekas
Copy link
Member

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 nicolas-grekas merged commit f5b6ee9 into symfony:3.4 Aug 20, 2019
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.
@derrabus derrabus deleted the bugfix/irp branch August 20, 2019 17:19
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants