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:
b97fe1
- released at 2023-05-30 06:37