Skip to content

[Routing] deprecate non string requirement names #27879

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
Jul 11, 2018

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Jul 6, 2018

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Basically, this will help catching wrong @Route annotation configurations like the following which can lead to hard to debug issues:

@Route("/{foo}", requirements={"foo", "bar"}) 

@xabbuh
Copy link
Member Author

xabbuh commented Jul 6, 2018

An alternative solution could be to catch such cases in the annotation loader and provide a meaningful error/warning message.

@xabbuh xabbuh force-pushed the routing-non-string-requirement-names branch 2 times, most recently from 7f836be to 746f38b Compare July 9, 2018 13:18
@xabbuh xabbuh force-pushed the routing-non-string-requirement-names branch from 746f38b to 8bb5266 Compare July 9, 2018 13:38
@fabpot
Copy link
Member

fabpot commented Jul 11, 2018

Thank you @xabbuh.

@fabpot fabpot merged commit 8bb5266 into symfony:master Jul 11, 2018
fabpot added a commit that referenced this pull request Jul 11, 2018
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Routing] deprecate non string requirement names

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Basically, this will help catching wrong `@Route` annotation configurations like the following which can lead to hard to debug issues:

```php
@route("/{foo}", requirements={"foo", "bar"})
```

Commits
-------

8bb5266 deprecate non string requirement names
@xabbuh xabbuh deleted the routing-non-string-requirement-names branch July 11, 2018 15:55
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.2 Nov 1, 2018
This was referenced Nov 3, 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.

5 participants