-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] Revert the change in [#b42018] with respect to Routing/Route.php #23121
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
…e it breaks BC. Refers to symfony#21090 and symfony#23109
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.
Can you add a comment explaining why we cannot restrict the allowed classes in this case? And add a test to avoid any regression in the future?
As requested, I have amended the comment in the pull request and added a test. Let me know if you'd like anything else. |
@@ -221,6 +221,21 @@ public function testSerializeWhenCompiled() | |||
} | |||
|
|||
/** | |||
* Tests that the compiled version does not fail when the Route refers to | |||
* arbitrary classes. |
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.
Does not seem to be why we are doing it. We only want to ensure that the compiled route can be different from CompiledRoute, not that you can use any object on the route definition, which is not supported.
|
||
class CustomRouteCompiler extends RouteCompiler | ||
{ | ||
/** |
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.
extra space
try { | ||
$unserialized = unserialize($serialized); | ||
$this->assertInstanceOf('\Symfony\Component\Routing\Tests\Fixtures\CustomCompiledRoute', $unserialized->compile(), 'the unserialized route compiled successfully'); | ||
} catch (\Exception $except) { |
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.
should be $e
Thank you @Gribnif. |
…outing/Route.php (Dan Wilga) This PR was submitted for the master branch but it was merged into the 3.3 branch instead (closes #23121). Discussion ---------- [Routing] Revert the change in [#b42018] with respect to Routing/Route.php | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #21090 #23109 | License | MIT | Doc PR | ...because it breaks BC with third-party code which, for instance, might use a subclass of CompiledRoute within the options portion of the Route. Refers to #21090 and #23109 Commits ------- f09893b [Routing] Revert the change in [#b42018] with respect to Routing/Route.php
...because it breaks BC with third-party code which, for instance, might use a subclass of CompiledRoute within the options portion of the Route. Refers to #21090 and #23109