Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Routing] Make important parameters required when matching#29770
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[Routing] Make important parameters required when matching#29770
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
vudaltsov commentedJan 4, 2019
As discussed with@nicolas-grekas ,#29763 will be implemented in this PR as well :) |
7ae21c9 to098ab7bCompare| for ($i =\count($tokens) -1;$i >=0; --$i) { | ||
| $token =$tokens[$i]; | ||
| if ('variable' ===$token[0] &&$route->hasDefault($token[3])) { | ||
| if ('variable' ===$token[0] &&!$token[5] &&$route->hasDefault($token[3])) { |
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.
Here is the change that prevents matching
vudaltsov commentedJan 4, 2019
@nicolas-grekas , ready! |
vudaltsov commentedJan 4, 2019
CI fails are not relevant (I see some Intl component errors), Routing is green locally :) |
f18a6e1 toca35103Comparevudaltsov commentedJan 15, 2019
Finally green and ready! |
4bd3fc8 to8d4be10CompareUh oh!
There was an error while loading.Please reload this page.
8d4be10 to2c3ab22Comparevudaltsov commentedJan 25, 2019
@nicolas-grekas , I managed to keep consistency with old tests! |
nicolas-grekas commentedJan 25, 2019
Thank you@vudaltsov. |
… (vudaltsov)This PR was merged into the 4.3-dev branch.Discussion----------[Routing] Make important parameters required when matching| Q | A| ------------- | ---| Branch? | master| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#29763| License | MIT| Doc PR | n/a1. This PR improves "important" route parameters implementation. Instead of considering `!slug` to be a variable name (which is not correct from my POV and leads to a lot of `'!' === $varName[0]` and `substr($varName, 1)` snippets), I took advantage of the `$token` array and used offset `[5]` for keeping boolean importance flag. This approach improved and simplified code.1. This PR makes important parameters required when matching according to#29763Commits-------2c3ab22 Made important parameters required when matching
Uh oh!
There was an error while loading.Please reload this page.
!slugto be a variable name (which is not correct from my POV and leads to a lot of'!' === $varName[0]andsubstr($varName, 1)snippets), I took advantage of the$tokenarray and used offset[5]for keeping boolean importance flag. This approach improved and simplified code.!prefixed placeholders should make them required #29763