About Rector
Hire Team
Try Rector
Contact
Blog
Docs
Run Rector on your code to see what it can do for you:
<?php final class DemoFile { public function run() { return 5; // we never get here return 10; } }
Config
rector.php
<?php use Rector\Config\RectorConfig; use Rector\Set\ValueObject\SetList; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; return static function (RectorConfig $rectorConfig): void { // A. run whole set $rectorConfig->sets([ SetList::DEAD_CODE, ]); // B. or single rule $rectorConfig->rule(TypedPropertyFromAssignsRector::class); };
Process
Rector version:
dev-main@84eb4a
released at 2023-02-02 17:49