Try Rector
Docs
Hire Team
Find Rule
Blog
Contact
AST
Try Rector
Docs
Hire Team
Find Rule
Blog
Contact
AST
Run Rector on your code to see what it can do for you:
// no change
PHP snippet to change
<?php abstract class AbstractDemo { abstract public function demo(string $demo):void; } final class DemoFile extends AbstractDemo { public function demo(string $demo):void{ } }
Config
rector.php
<?php use Rector\Config\RectorConfig; use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector; return RectorConfig::configure() // A. whole set ->withPreparedSets(typeDeclarations: true) // B. or few rules ->withRules([ AddOverrideAttributeToOverriddenMethodsRector::class ]);
Run Rector
Rector version:
ac3a94
- released at 2025-05-11 00:39