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 namespace Alpha { class X { public $var1; public $var2; } class Y extends X { public function setVarOne ($val): void { $this->var1 = $val; } } class Z extends Y { public function setVatTwo ($val): void { $this->var2 = $val; } } }
Config
rector.php
<?php use Rector\Config\RectorConfig; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; use Rector\ValueObject\PhpVersion; return RectorConfig::configure() ->withRules([ Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector::class ]) // demonstrate specific PHP version ->withPhpSets ( php83: true, );
Run Rector
Rector version:
735362
- released at 2025-09-23 02:00