Skip to content

Commit

Permalink
updated rector-config, added short-command
Browse files Browse the repository at this point in the history
  • Loading branch information
kohlerdominik committed Dec 6, 2024
1 parent d61a3a3 commit 1f73d6b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"cs:fix": "vendor/bin/php-cs-fixer fix --verbose",
"cs:diff": "vendor/bin/php-cs-fixer fix --dry-run --diff --verbose",
"phpstan": "vendor/bin/phpstan analyse",
"phpunit": "vendor/bin/phpunit --verbose"
"phpunit": "vendor/bin/phpunit --verbose",
"rector": "vendor/bin/rector"
},
"conflict": {
"khanamiryan/qrcode-detector-decoder": "1.0.6"
Expand Down
19 changes: 6 additions & 13 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,13 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Set\ValueObject\SetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
return RectorConfig::configure()
->withPaths([
__DIR__ . '/example',
__DIR__ . '/src',
__DIR__ . '/tests',
]);

$rectorConfig->importNames(true);
$rectorConfig->importShortClasses(false)

$rectorConfig->sets([SetList::PHP_81]);

$rectorConfig->rule(ClassPropertyAssignToConstructorPromotionRector::class);
};
])->withImportNames(importShortClasses: false, removeUnusedImports: true)
->withPhpSets() //checks composer.json for supported php versions
//->withAttributesSets(all: true)
;

0 comments on commit 1f73d6b

Please sign in to comment.