-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] Construct Route annotations using named arguments #40266
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
Hey! I did a quick review of this PR, I think most things looks good. I think @mtarld has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
nicolas-grekas
approved these changes
Feb 22, 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.
(rebase needed)
8b1a3aa
to
d70dcc9
Compare
OskarStark
reviewed
Feb 22, 2021
d70dcc9
to
29b0f96
Compare
fabpot
approved these changes
Feb 25, 2021
Thank you @derrabus. |
fabpot
added a commit
that referenced
this pull request
Apr 8, 2021
…ts (derrabus) This PR was merged into the 5.3-dev branch. Discussion ---------- [Serializer] Construct annotations using named arguments | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | no | Deprecations? | yes | Tickets | N/A | License | MIT | Doc PR | Not needed This is the same as #40266, but applied to the serializer annotations. This PR proposes to bump the `doctrine/annotations` library to 1.12 to gain access to its emulation layer for named arguments. Furthermore, constructing any of the serializer's annotation classes the old way by passing an array of parameters is deprecated. ### Reasons for this change The constructors of our annotation classes have become unnecessarily complicated because we have to support two ways of calling them: * An array of parameters, passed as first argument, because that's the default behavior `doctrine/annotations`. * A set of named arguments because that's how PHP 8 attributes work. Since we can now tell the Doctrine annotation reader to use named arguments as well, we can simplify the constructors of our annotations significantly. ### Drawback After this change, there is no easy way anymore to construct instances of most of the annotation classes directly on PHP 7. The PR has been built under the assumption that instances of this class are usually created using either Doctrine annotations or a PHP 8 attribute. Thus, most applications should be unaffected by this change. Commits ------- c116662 [Serializer] Construct annotations using named arguments
Merged
derrabus
added a commit
that referenced
this pull request
May 2, 2021
This PR was merged into the 5.3-dev branch. Discussion ---------- [Routing] Fix localized paths | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Related to #40266, localized paths does not work anymore. This PR aims to fix that and add a rework on the tests (using real annotations/attributes instead of guessing the parsing that may lead to errors). Commits ------- 9bf4a24 [Routing] Fix localized paths
hultberg
pushed a commit
to hultberg/symfony
that referenced
this pull request
Sep 17, 2021
…arguments (derrabus) This PR was merged into the 5.3-dev branch. Discussion ---------- [Serializer] Construct annotations using named arguments | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | no | Deprecations? | yes | Tickets | N/A | License | MIT | Doc PR | Not needed This is the same as symfony#40266, but applied to the serializer annotations. This PR proposes to bump the `doctrine/annotations` library to 1.12 to gain access to its emulation layer for named arguments. Furthermore, constructing any of the serializer's annotation classes the old way by passing an array of parameters is deprecated. ### Reasons for this change The constructors of our annotation classes have become unnecessarily complicated because we have to support two ways of calling them: * An array of parameters, passed as first argument, because that's the default behavior `doctrine/annotations`. * A set of named arguments because that's how PHP 8 attributes work. Since we can now tell the Doctrine annotation reader to use named arguments as well, we can simplify the constructors of our annotations significantly. ### Drawback After this change, there is no easy way anymore to construct instances of most of the annotation classes directly on PHP 7. The PR has been built under the assumption that instances of this class are usually created using either Doctrine annotations or a PHP 8 attribute. Thus, most applications should be unaffected by this change. Commits ------- c116662 [Serializer] Construct annotations using named arguments
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.
This PR proposes to bump the
doctrine/annotations
library to 1.12 to gain access to its emulation layer for named arguments. Furthermore, constructing aRoute
annotation the old way by passing an array of parameters is deprecated.Reasons for this change
The constructors of our annotation classes have become unnecessarily complicated because we have to support two ways of calling them:
doctrine/annotations
.Since we can now tell the Doctrine annotation reader to use named arguments as well, we can simplify the constructors of our annotations significantly.
Drawback
After this change, there is no easy way anymore to construct instances of the
Route
annotation class directly on PHP 7. The PR has been built under the assumption that instances of this class are usually created using either Doctrine annotations or a PHP 8 attribute. Thus, most applications should be unaffected by this change.