Try Rector
Documentation
Hire Team
Blog
Contact
Try Rector
Documentation
Hire Team
Blog
Contact
Run Rector on your code to see what it can do for you:
// no change
PHP snippet to change
<?php use App\Service\DocumentService; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; class ExampleController extends AbstractController { public function example(DocumentService $documentService): void { $documentService->someMethod(); } }
Config
rector.php
<?php use Rector\Config\RectorConfig; use Rector\Symfony\CodeQuality\Rector\Class_\ControllerMethodInjectionToConstructorRector; use Rector\ValueObject\PhpVersion; return RectorConfig::configure() ->withRules([ ControllerMethodInjectionToConstructorRector::class, ]) // demonstrate specific PHP version ->withPhpVersion(PhpVersion::PHP_81);
Run Rector
Rector version:
0ff467
- released at 2026-07-05 23:08