Skip to content

Commit

Permalink
Added Rector to Makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
corpsee committed Feb 10, 2024
1 parent 06e6ca4 commit 8316fe9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 11 additions & 6 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,*/
]);
};

0 comments on commit 8316fe9

Please sign in to comment.