[9.x] Removed action from SymfonyRoute options #35542
Merged
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 is a
master
PR of this original PR: #35451The text below is copied from that original PR.
Description
Illuminate\Routing\Route::toSymfonyRoute()
included two options:utf8
andaction
. The options do not include acompiler_class
option so the defaultSymfony\Component\Routing\RouteCompiler
will always be used. This compiler does not utilize anaction
parameter and, because you cannot override theRouteCompiler
, I have removed that option from thetoSymfonyRoute()
options array.Unit Tests
This PR removes unused code so no new unit tests would be useful. Removing the ephemera and testing with the current unit tests shows this does not affect the framework.
Discussion
Removing this unused (in Symfony) code from the Route simplifies the
toSymfonyRoute()
method and prevents developers from going on a wild goose chase to figure out why this code is there in the first place. There is no direct benefit to the end consumer.The extraneous option was sent to Symfony classes so there are no Laravel unit tests which could apply to the call to the constructor of the Symfony Route class.
This change benefits the developer community around Laravel by only including code which has a purpose.
External Resources
This change is directed against the constructor of https://github.com/symfony/symfony/blob/5.x/src/Symfony/Component/Routing/Route.php#L53
and involves the route compiler https://github.com/symfony/symfony/blob/5.x/src/Symfony/Component/Routing/RouteCompiler.php
Additionally the valid options are listed in the comments of the constructor: https://github.com/symfony/symfony/blob/5.x/src/Symfony/Component/Routing/Route.php#L41