Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Routing] DeprecateRouteCollection overriding its routes' properties#60343

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
MatTheCat wants to merge1 commit intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromMatTheCat:ticket_53171

Conversation

MatTheCat
Copy link
Contributor

@MatTheCatMatTheCat commentedMay 4, 2025
edited
Loading

QA
Branch?7.4
Bug fix?no
New feature?no
Deprecations?yes
IssuesN/A
LicenseMIT

In Symfony, route collections’ methods, schemes, host, defaults, requirements and condition end up overriding their routes’ which is counter-intuitive: it means e.g. every route in a collection whose method isPOST will have the same, even if they were configured through theRoute attribute with aGET method.

Even if doing this has currently no effect and is probably a mistake, changing this behavior would be a BC break so this PR starts by deprecating it.

Then,#53171 can be fixed in 8.0 by changing the conditions and moving the call to routes’ setter into it, e.g.

foreach ($this->routes as $route) {-    if ('' !== $route->getHost() && $route->getHost() !== $pattern) {-        trigger_deprecation('symfony/routing', '7.3', 'Overriding a route\'s host with its group\'s is deprecated, you should remove it from the route.');+    if ('' === $route->getHost()) {+        $route->setHost($pattern);    }-    $route->setHost($pattern);}

I’ll be waiting for an approval before updating loaders tests because it looks like it’ll be tedious.

@carsonbotcarsonbot added this to the7.3 milestoneMay 4, 2025
@carsonbotcarsonbot changed the titleDeprecateRouteCollection overriding its routes' properties[Routing] DeprecateRouteCollection overriding its routes' propertiesMay 5, 2025
@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
@MatTheCatMatTheCatforce-pushed theticket_53171 branch 2 times, most recently fromd22f78a to1b7c04bCompareMay 29, 2025 08:11
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

4 participants
@MatTheCat@fabpot@OskarStark@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp