diff --git a/Makefile b/Makefile index 64ca9cb..b73c270 100644 --- a/Makefile +++ b/Makefile @@ -31,5 +31,8 @@ code-style-fix: php-info install ## Fix code style psalm: php-info install ## Run Psalm check $(PHP) vendor/bin/psalm --config=psalm.xml.dist --threads=4 --show-snippet=true --show-info=true -.PHONY: php-info list install install-force update test test-coverage mutation-test code-style-fix psalm +rector: php-info install ## Run Rector + $(PHP) vendor/bin/rector process --clear-cache --dry-run + +.PHONY: php-info list install install-force update test test-coverage mutation-test code-style-fix psalm rector .DEFAULT_GOAL := list diff --git a/rector.php b/rector.php index af80c4a..bf7a4d5 100644 --- a/rector.php +++ b/rector.php @@ -5,21 +5,26 @@ use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; +//use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { $rectorConfig->paths([ - __DIR__ . '/src' + __DIR__ . '/src', + __DIR__ . '/tests', ]); + $rectorConfig->skip([]); + + $rectorConfig->importNames(); + $rectorConfig->importShortClasses(false); + // register a single rule $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); $rectorConfig->sets([ LevelSetList::UP_TO_PHP_81, - //SetList::PHP_81, - //SetList::CODE_QUALITY, - //SetList::TYPE_DECLARATION_STRICT, - //SetList::DEAD_CODE, +/* SetList::PHP_81, + SetList::CODE_QUALITY, + SetList::DEAD_CODE,*/ ]); };