Skip to content

Commit ae53d01

Browse files
committed
Update composer json and rector
1 parent 1781ed8 commit ae53d01

2 files changed

Lines changed: 40 additions & 6 deletions

File tree

composer.json

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"php": ">=8.1"
1010
},
1111
"require-dev": {
12+
"ergebnis/composer-normalize": "^2.50",
1213
"friendsofphp/php-cs-fixer": "^3.89",
1314
"phpstan/phpstan": "^2.1",
1415
"rector/rector": "^2.2",
@@ -22,6 +23,34 @@
2223
}
2324
},
2425
"config": {
25-
"sort-packages": true
26+
"sort-packages": true,
27+
"allow-plugins": {
28+
"ergebnis/composer-normalize": true
29+
}
30+
},
31+
"scripts": {
32+
"fix": [
33+
"vendor/bin/rector process src tests",
34+
"vendor/bin/php-cs-fixer fix --diff",
35+
"composer normalize"
36+
],
37+
"run-tests" : [
38+
"composer validate --strict --no-check-lock --ansi",
39+
"XDEBUG_MODE=coverage vendor/bin/phpunit",
40+
"vendor/bin/rector process src tests --dry-run",
41+
"vendor/bin/phpstan analyse src tests --level 5",
42+
"vendor/bin/php-cs-fixer fix --dry-run --diff",
43+
"vendor/bin/yaml-lint .github/ -vvv --parse-tags",
44+
"vendor/bin/yaml-lint config/ -vvv --parse-tags",
45+
"vendor/bin/yaml-lint translations/ -vvv --parse-tags"
46+
],
47+
"test": [
48+
"composer update --no-scripts --ansi",
49+
"@run-tests"
50+
],
51+
"test-bc": [
52+
"composer update --no-scripts --ansi --prefer-lowest --prefer-stable",
53+
"@run-tests"
54+
]
2655
}
2756
}

rector.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
use Rector\Config\RectorConfig;
56
use Rector\Set\ValueObject\SetList;
67
use Rector\Symfony\Set\SymfonySetList;
8+
use Rector\Symfony\Symfony61\Rector\Class_\CommandConfigureToAttributeRector;
79
use Rector\ValueObject\PhpVersion;
810

911
return RectorConfig::configure()
10-
->withPaths(array_merge(
11-
is_dir(__DIR__ . '/src') ? [__DIR__ . '/src'] : [],
12-
is_dir(__DIR__ . '/tests') ? [__DIR__ . '/tests'] : []
13-
))
12+
->withPaths(array_values(array_filter([
13+
is_dir(__DIR__.'/src') ? __DIR__.'/src' : null,
14+
is_dir(__DIR__.'/tests') ? __DIR__.'/tests' : null,
15+
])))
1416
->withSets([
1517
SymfonySetList::SYMFONY_80,
1618
SetList::CODE_QUALITY,
1719
SetList::DEAD_CODE,
1820
SetList::TYPE_DECLARATION,
1921
])
2022
->withPhpVersion(PhpVersion::PHP_84)
21-
->withComposerBased(symfony: true);
23+
->withComposerBased(symfony: true)
24+
->withSkip([
25+
CommandConfigureToAttributeRector::class,
26+
]);

0 commit comments

Comments
 (0)