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 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:
2.5.7
- released at 2026-07-13 15:49