Skip to content

Conversation

@mickverm
Copy link
Contributor

@mickverm mickverm commented Jan 23, 2026

During development on a Symfony 7.x project, I noticed a deprecated Symfony routing attribute was introduced, about which PHPStan complained.

  :27    Attribute class Symfony\Component\Routing\Annotation\Route is deprecated: since Symfony 7.4, use {@see \Symfony\Component\Routing\Attribute\Route} instead
         🪪  attribute.deprecated
  :27    Attribute references deprecated class Symfony\Component\Routing\Annotation\Route:
         since Symfony 7.4, use {@see \Symfony\Component\Routing\Attribute\Route} instead
         🪪  attribute.deprecatedClass

I was relatively sure that Rector replaced these, but it turns out it only does so on Symfony 6.4, see: https://github.com/rectorphp/rector-src/blob/b855ff8d2228d11898d847a85b36d3e55de98cb8/src/Set/ValueObject/ComposerTriggeredSet.php#L52

@@ -0,0 +1,16 @@
<?php
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a copy of config/sets/symfony/symfony6/symfony64/symfony64-routing.php. If preferred, I could import that file into the other files instead.

@TomasVotruba TomasVotruba merged commit 582fc7c into rectorphp:main Jan 23, 2026
7 checks passed
@TomasVotruba
Copy link
Member

Looks good, thank you 👍

@mickverm mickverm deleted the symfony-7.x-routing-annotation-to-attribute branch January 23, 2026 16:48
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.

2 participants