RouteAttributeGetterToPropertyRector
Replace deprecated Route attribute getters with public properties
use Symfony\Component\Routing\Attribute\Route;
function run(Route $route)
{
- return $route->getName();
+ return $route->name;
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\Symfony\Symfony80\Rector\MethodCall\RouteAttributeGetterToPropertyRector;
return RectorConfig::configure()
->withRules([
RouteAttributeGetterToPropertyRector::class,
]);
PACKAGE:
symfony/routing >=7.4