-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] simplify PhpMatcherDumper by splitting code logic from route data #28798
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
Conversation
08c8104
to
22186c7
Compare
(fabbot fixed) |
Thank you @nicolas-grekas. |
…gic from route data (nicolas-grekas) This PR was merged into the 4.2-dev branch. Discussion ---------- [Routing] simplify PhpMatcherDumper by splitting code logic from route data | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This PR splits all logic that is currently dumped into the matcher in a dedicated trait. This makes the code easier to maintain and prepares for the next step (making the dumper compile routes as a set of PHP arrays instead of code.) This diff is huge because affected fixtures are also huge, but it's negative, removing 1200 lines! Commits ------- 22186c7 [Routing] simplify PhpMatcherDumper by splitting code logic from route data
@@ -56,13 +55,11 @@ public function dump(array $options = array()) | |||
|
|||
// trailing slash support is only enabled if we know how to redirect the user | |||
$interfaces = class_implements($options['base_class']); | |||
$supportsRedirections = isset($interfaces[RedirectableUrlMatcherInterface::class]); |
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.
what about this distinction between supporting it or no ? Is it gone ?
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.
Yes it's gone, it fits no purpose.
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.
Oups, totally unrelated answer I had something else in mind :)
So no, it's not gone, it's here:
https://github.com/symfony/symfony/pull/28798/files#diff-b510c08a4adf31a17002f25ee499fb85R41
This PR splits all logic that is currently dumped into the matcher in a dedicated trait.
This makes the code easier to maintain and prepares for the next step (making the dumper compile routes as a set of PHP arrays instead of code.)
This diff is huge because affected fixtures are also huge, but it's negative, removing 1200 lines!