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 class test { private function a(): int { return 1; } public static function b(): void { self::a(); } } test::b();
Config
rector.php
<?php use Rector\Config\RectorConfig; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; use Rector\ValueObject\PhpVersion; return RectorConfig::configure() // A. whole set ->withPreparedSets(typeDeclarations: true) // demonstrate specific PHP version ->withPhpVersion(PhpVersion::PHP_80) ->withSets([ \Rector\Set\ValueObject\SetList::PHP_70, \Rector\Set\ValueObject\SetList::PHP_71, \Rector\Set\ValueObject\SetList::PHP_72, \Rector\Set\ValueObject\SetList::PHP_73, \Rector\Set\ValueObject\SetList::PHP_74, \Rector\Set\ValueObject\SetList::PHP_80 ]);
Run Rector
Rector version:
2f9ec7
- released at 2026-06-28 01:03