Skip to content

Commit d581d2f

Browse files
committed
[dev] remove rule definitions, to make easier to add new rule and make them less complex
1 parent 7d2daec commit d581d2f

34 files changed

+35
-2065
lines changed

build/rector-downgrade-php-74.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,11 @@
44

55
use Rector\Config\RectorConfig;
66
use Rector\Removing\Rector\Class_\RemoveInterfacesRector;
7-
use Rector\Set\ValueObject\DowngradeLevelSetList;
87
use Symplify\RuleDocGenerator\Contract\ConfigurableRuleInterface;
9-
use Symplify\RuleDocGenerator\Contract\DocumentedRuleInterface;
108

11-
return static function (RectorConfig $rectorConfig): void {
12-
$rectorConfig->parallel();
13-
14-
$rectorConfig->sets([DowngradeLevelSetList::DOWN_TO_PHP_74]);
15-
16-
$rectorConfig->ruleWithConfiguration(RemoveInterfacesRector::class, [
17-
DocumentedRuleInterface::class,
9+
return RectorConfig::configure()
10+
->withDowngradeSets(php74: true)
11+
->withConfiguredRule(RemoveInterfacesRector::class, [
1812
ConfigurableRuleInterface::class,
19-
]);
20-
21-
$rectorConfig->skip(['*/Tests/*', '*/tests/*', __DIR__ . '/../../tests']);
22-
};
23-
13+
])
14+
->withSkip(['*/Tests/*', '*/tests/*', __DIR__ . '/../../tests']);

composer.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
"php": ">=8.1",
88
"nette/utils": "^3.2.9 || ^4.0",
99
"webmozart/assert": "^1.11",
10-
"phpstan/phpstan": "^2.0",
11-
"symplify/rule-doc-generator-contracts": "^11.2"
10+
"phpstan/phpstan": "^2.0"
1211
},
1312
"require-dev": {
1413
"nikic/php-parser": "^5.0",
15-
"symplify/rule-doc-generator": "^12.2",
1614
"phpunit/phpunit": "^10.5",
1715
"symfony/framework-bundle": "6.1.*",
1816
"symplify/easy-coding-standard": "^12.3",
@@ -52,7 +50,6 @@
5250
"check-cs": "vendor/bin/ecs check --ansi",
5351
"fix-cs": "vendor/bin/ecs check --fix --ansi",
5452
"phpstan": "vendor/bin/phpstan analyse --ansi",
55-
"rector": "vendor/bin/rector process --dry-run --ansi",
56-
"docs": "vendor/bin/rule-doc-generator generate src --readme --ansi"
53+
"rector": "vendor/bin/rector process --dry-run --ansi"
5754
}
5855
}

0 commit comments

Comments
 (0)