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(bool $param) { if ($this->isTrue($param)) { return 5; } return '10'; } private function isTrue($value) { return $value === true; } }
Config
rector.php
<?php use Rector\Config\RectorConfig; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; return RectorConfig::configure() // A. whole set ->withPreparedSets(typeDeclarations: true) // B. or few rules ->withRules([ TypedPropertyFromAssignsRector::class ]);
Process
Rector version:
56e203
- released at 2024-04-18 04:00