Change annotation to attribute
use Symfony\Component\Routing\Annotation\Route;
class SymfonyRoute
{
- /**
- * @Route("/path", name="action")
- */
+ #[Route(path: '/path', name: 'action')]
public function action()
{
}
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
use Rector\Php80\ValueObject\AnnotationToAttribute;
return RectorConfig::configure()
->withConfiguredRule(AnnotationToAttributeRector::class, [
new AnnotationToAttribute('Symfony\Component\Routing\Annotation\Route'),
]);