-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] UrlGenerator::doGenerate uses deprecated functionality #8176
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
Comments
I think it should be something like this. If the Route requires one of multiple schemes just pick the first for generation.
And for code readability and to be able to call $route->getSchemes() I would suggest to change the doGenerate() method to: |
Your signature doesnt work. Its used by the dumped generator for performance. |
Ah haven't seen that. Tricky one... |
…anez) This PR was merged into the 2.3 branch. Discussion ---------- [Routing] Remove usage of deprecated _scheme requirement **This is exact the same commit as it was in #9585, which was not merged due to my fault. Sorry for the noise.** | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #8898, #8176 | License | MIT | Doc PR | I removed all usages of the deprecated _scheme requirement inside the Routing Component. Most parts were pretty easy and after multiple refactorings I came up with the solution to have a Route::hasScheme() method and check against this method. I also checked for performance and after trying in_array, arra_flip+isset and foreach, the last one was clearly the winner. https://gist.github.com/Danez/7609898#file-test_performance-php I also adjusted all tests that test '_scheme' to also check the new schemes-requirement. Commits ------- 557dfaa Remove usage of deprecated _scheme in Routing Component
The
UrlGenerator::doGenerate
method expects the "_scheme" requirement to be part of$route->getRequirements()
which is deprecated. It's in$route->getSchemes()
now.So the signiture of the method enforces people to use a deprecated feature.
I think it should be fixed for 2.3.
The text was updated successfully, but these errors were encountered: