Skip to content
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

Fix return types for PHP 8.1 #42260

Merged
merged 1 commit into from Aug 4, 2021

Conversation

@derrabus
Copy link
Member

@derrabus derrabus commented Jul 26, 2021

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #42199, Fix #42231, Part of #41552
License MIT
Doc PR N/A
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Did you use some tool to generate this? It'd be cool to document how we did so that others can do the same I their libs.

@derrabus
Copy link
Member Author

@derrabus derrabus commented Jul 26, 2021

Did you use some tool to generate this? It'd be cool to document how we did so that others can do the same I their libs.

No, this was manual work. I used PhpStorm to find all implementations of Countable, IteratorAggregate and friends. For each case I checked individually whether I can add a return type directly or need to add the attribute. I also checked for each occurrence if the @return annotation is equivalent or covariant to the return type in PHP 8.1.

@sebastianbergmann
Copy link
Contributor

@sebastianbergmann sebastianbergmann commented Jul 27, 2021

No, this was manual work.

Would be nice if that did not have to be the case. CC @TomasVotruba

@TomasVotruba
Copy link
Contributor

@TomasVotruba TomasVotruba commented Jul 27, 2021

@sebastianbergmann Depends how much time it took to do. If its < 30 minutes, than automation would take longer.

@derrabus
Copy link
Member Author

@derrabus derrabus commented Jul 27, 2021

@sebastianbergmann Depends how much time it took to do. If its < 30 minutes, than automation would take longer.

I was definitely faster than 30 min. 😎

@sebastianbergmann
Copy link
Contributor

@sebastianbergmann sebastianbergmann commented Jul 27, 2021

@sebastianbergmann Depends how much time it took to do. If its < 30 minutes, than automation would take longer.
I was definitely faster than 30 min. 😎

Sorry for the noise.

@TomasVotruba
Copy link
Contributor

@TomasVotruba TomasVotruba commented Jul 28, 2021

@sebastianbergmann Thanks for the ping. If this would be something that every Symfony user has to change in their projects too, saved times is enourmous.

@wouterj

This comment has been hidden.

@derrabus
Copy link
Member Author

@derrabus derrabus commented Aug 3, 2021

@wouterj This PR already includes that change. Code reviews welcome. 🙂

@wouterj
wouterj approved these changes Aug 3, 2021
Copy link
Member

@wouterj wouterj left a comment

Oh, missed that. Looks good!

@derrabus derrabus force-pushed the derrabus:bugfix/return-type-will-change branch from 1b6624b to 3eca446 Aug 4, 2021
@derrabus
Copy link
Member Author

@derrabus derrabus commented Aug 4, 2021

@symfony/mergers Merging this PR would remove some noise from our CI. Any objections against it?

@Nyholm
Nyholm approved these changes Aug 4, 2021
Copy link
Member

@Nyholm Nyholm left a comment

Im happy with this PR.

I dont know if this is complete or not. But if we missed some iterator we can fix them in a follow up PR.

@derrabus derrabus merged commit 5b1fc10 into symfony:4.4 Aug 4, 2021
9 of 11 checks passed
9 of 11 checks passed
@github-actions
Tests (7.1)
Details
@github-actions
Tests (7.2)
Details
@github-actions
Psalm
Details
@github-actions
Tests (8.0)
Details
@github-actions
Tests (8.0)
Details
@github-actions
Tests (7.4, high-deps) Tests (7.4, high-deps)
Details
@github-actions
Tests (8.0, low-deps)
Details
@github-actions
Tests (8.1, experimental) Tests (8.1, experimental)
Details
fabbot.io Some changes should be done to comply with our standards.
Details
@travis-ci
Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@derrabus derrabus deleted the derrabus:bugfix/return-type-will-change branch Aug 4, 2021
@derrabus
Copy link
Member Author

@derrabus derrabus commented Aug 4, 2021

Thanks everyone. ❤️

@derrabus
Copy link
Member Author

@derrabus derrabus commented Aug 4, 2021

Follow-up for the 5.3 branch: #42379

Tobion added a commit that referenced this pull request Aug 4, 2021
This PR was merged into the 5.3 branch.

Discussion
----------

Fix return types for PHP 8.1

| Q             | A
| ------------- | ---
| Branch?       | 5.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #41552
| License       | MIT
| Doc PR        | N/A

Follow-up of #42260.

Commits
-------

ab3c43f Fix return types for PHP 8.1
This was referenced Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment