Skip to content

[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

Merged
merged 1 commit into from
Oct 10, 2018

Conversation

nicolas-grekas
Copy link
Member

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!

@nicolas-grekas
Copy link
Member Author

(fabbot fixed)

@fabpot
Copy link
Member

fabpot commented Oct 10, 2018

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 22186c7 into symfony:master Oct 10, 2018
fabpot added a commit that referenced this pull request Oct 10, 2018
…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]);
Copy link
Member

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 ?

Copy link
Member Author

@nicolas-grekas nicolas-grekas Oct 10, 2018

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.

Copy link
Member Author

@nicolas-grekas nicolas-grekas Oct 10, 2018

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

@nicolas-grekas nicolas-grekas deleted the route-static-dump branch October 10, 2018 13:34
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.2 Nov 1, 2018
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.

4 participants