Skip to content

Commit

Permalink
Update composer targets
Browse files Browse the repository at this point in the history
Also add rector to qa tests
  • Loading branch information
usox committed Apr 14, 2023
1 parent 0b524e0 commit 27f264c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
22 changes: 16 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,21 @@
}
},
"scripts": {
"qa": "composer check-cs && composer stan && composer test",
"check-cs": "./vendor/bin/php-cs-fixer fix --dry-run --diff",
"fix-cs": "./vendor/bin/php-cs-fixer fix",
"test": "./vendor/bin/phpunit tests",
"stan": "./vendor/bin/phpstan analyse",
"coverage": "./vendor/bin/phpunit --warm-coverage-cache tests && XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-html build/coverage tests"
"qa": [
"@composer check-cs",
"@composer stan",
"@composer rector:dry",
"@composer test"
],
"check-cs": "php-cs-fixer fix --dry-run --diff",
"fix-cs": "php-cs-fixer fix",
"test": "phpunit tests",
"stan": "phpstan analyse",
"rector:dry": "rector process -n",
"rector:fix": "rector process",
"coverage": [
"phpunit --warm-coverage-cache tests && XDEBUG_MODE=coverage",
"phpunit --coverage-html build/coverage tests"
]
}
}
8 changes: 5 additions & 3 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

declare(strict_types=1);

use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\Config\RectorConfig;
use Rector\Php74\Rector\Property\TypedPropertyRector;
use Rector\Php80\Rector\Catch_\RemoveUnusedVariableInCatchRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Set\ValueObject\SetList;
Expand All @@ -19,10 +19,12 @@
$rectorConfig->import(resource: SetList::CODE_QUALITY);
$rectorConfig->import(SetList::DEAD_CODE);
$rectorConfig->import(SetList::PHP_81);
$rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon');

$services = $rectorConfig->services();
$services->set(TypedPropertyRector::class);
$services->set(ClassPropertyAssignToConstructorPromotionRector::class);
$services->set(RemoveUnusedVariableInCatchRector::class);

$rectorConfig->skip([
FlipTypeControlToUseExclusiveTypeRector::class,
]);
};

0 comments on commit 27f264c

Please sign in to comment.