Rector is a FLOSS tool that instantly upgrades and refactors the PHP code of any PHP 5.3+ code.
https://github.com/rectorphp/rector
Documentation:
https://getrector.com/documentation
Configuration to be tested (please feel free to update as you test more):
```
<?php
// generated using `vendor/bin/rector init`
declare(strict_types=1);
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/conf',
__DIR__ . '/externals',
__DIR__ . '/resources',
__DIR__ . '/scripts',
__DIR__ . '/src',
__DIR__ . '/support',
__DIR__ . '/webroot',
]);
// https://getrector.com/documentation/import-names
// $rectorConfig->importNames();
$rectorConfig->sets( [
LevelSetList::UP_TO_PHP_81,
] );
};
```
Online demo:
https://getrector.com/demo