Skip to content
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

Fix compatibility of Route annotations with symfony >= 5.3 #2312

Merged

Conversation

W0rma
Copy link
Contributor

@W0rma W0rma commented Jun 21, 2021

Constructing Route annotations using named arguments was added in symfony 5.2 (symfony/symfony#40266)

Closes #2311

@W0rma W0rma changed the title Fix compatibility of Route annotations with symfony > 5.3 Fix compatibility of Route annotations with symfony >= 5.3 Jun 21, 2021
@W0rma W0rma force-pushed the route-annotation-compat-symfony-53 branch 3 times, most recently from 80df5be to d5ae9ce Compare June 21, 2021 06:58
@deluxetom
Copy link
Contributor

Can this be merged? it creates a lot of deprecation warnings in SF 5.3

@h4rvk4
Copy link

h4rvk4 commented Jul 28, 2021

+1

Copy link
Member

@GuilhemN GuilhemN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!
Ready for merge for me 👍🏻

@W0rma
Copy link
Contributor Author

W0rma commented Aug 5, 2021

Adding support for PHP8 attributes in Route annotations should be quite simple after this PR got merged.

@xabbuh Would you prefer a separate PR for adding attributes support or should I add it to this PR?

@xabbuh
Copy link
Member

xabbuh commented Aug 5, 2021

please create an additional PR for that

@Th3Mouk
Copy link
Contributor

Th3Mouk commented Aug 6, 2021

Hello @W0rma ! I made a similar implementation on a fork and if you want to keep the full compatibility of old annotations from <5.2 you need to add this.
Because it's currently managed by SF5, but no longer in SF6. So @Post("/articles", name="post_articles") will not work on SF6 without this little patch

@W0rma W0rma force-pushed the route-annotation-compat-symfony-53 branch from d5ae9ce to 2cf8dd7 Compare August 9, 2021 10:36
@W0rma
Copy link
Contributor Author

W0rma commented Aug 9, 2021

@Th3Mouk Thank you for the hint regarding compatibility with symfony 6.

My approach is a bit different since I want to enable native PHP 8 attributes afterwards. Nevertheless I now added an additional check which should ensure compatibility with symfony 6.

@W0rma W0rma mentioned this pull request Aug 10, 2021
@GuilhemN GuilhemN merged commit 1a4f1b6 into FriendsOfSymfony:3.x Aug 16, 2021
@GuilhemN
Copy link
Member

Thank you @W0rma!

@W0rma W0rma deleted the route-annotation-compat-symfony-53 branch August 30, 2021 12:30
@mbabker mbabker mentioned this pull request Oct 10, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Route annotation triggers deprecation in symfony 5.3
6 participants