Skip to content

Commit e92c03f

Browse files
authored
[dev] remove rule definitions, to make easier to add new rule and make them easier to work with (#148)
* [dev] remove rule definitions, to make easier to add new rule and make them less complex * static fixes for PHPStan 2 * Remove RequireAssertConfigureValueObjectRectorRule as depends on context and common sense
1 parent 7d2daec commit e92c03f

File tree

52 files changed

+418
-2483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+418
-2483
lines changed

.github/workflows/code_analysis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
# see https://github.com/shivammathur/setup-php
4545
- uses: shivammathur/setup-php@v2
4646
with:
47-
php-version: 8.1
47+
php-version: 8.2
4848
coverage: none
4949

5050
# composer install cache - https://github.com/ramsey/composer-install

.github/workflows/downgraded_release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
-
2121
uses: "shivammathur/setup-php@v2"
2222
with:
23-
php-version: 8.1
23+
php-version: 8.2
2424
coverage: none
2525

2626
# invoke patches

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: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@
44
"description": "Set of Symplify rules for PHPStan",
55
"license": "MIT",
66
"require": {
7-
"php": ">=8.1",
8-
"nette/utils": "^3.2.9 || ^4.0",
7+
"php": ">=8.2",
8+
"nette/utils": "^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": {
14-
"nikic/php-parser": "^5.0",
15-
"symplify/rule-doc-generator": "^12.2",
16-
"phpunit/phpunit": "^10.5",
13+
"nikic/php-parser": "^5.3",
14+
"phpunit/phpunit": "^11.5",
1715
"symfony/framework-bundle": "6.1.*",
18-
"symplify/easy-coding-standard": "^12.3",
16+
"symplify/easy-coding-standard": "^12.5",
1917
"tomasvotruba/class-leak": "^1.2",
2018
"rector/rector": "^2.0",
21-
"phpstan/extension-installer": "^1.4"
19+
"phpstan/extension-installer": "^1.4",
20+
"symplify/phpstan-extensions": "^12.0"
2221
},
2322
"autoload": {
2423
"psr-4": {
@@ -52,7 +51,6 @@
5251
"check-cs": "vendor/bin/ecs check --ansi",
5352
"fix-cs": "vendor/bin/ecs check --fix --ansi",
5453
"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"
54+
"rector": "vendor/bin/rector process --dry-run --ansi"
5755
}
5856
}

config/rector-rules.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
rules:
22
- Symplify\PHPStanRules\Rules\Rector\PhpUpgradeDowngradeRegisteredInSetRule
33
- Symplify\PHPStanRules\Rules\Rector\PhpUpgradeImplementsMinPhpVersionInterfaceRule
4-
- Symplify\PHPStanRules\Rules\Rector\RequireAssertConfigureValueObjectRectorRule
54
- Symplify\PHPStanRules\Rules\Rector\NoInstanceOfStaticReflectionRule
65
- Symplify\PHPStanRules\Rules\Rector\NoLeadingBackslashInNameRule
76
- Symplify\PHPStanRules\Rules\Rector\NoClassReflectionStaticReflectionRule

0 commit comments

Comments
 (0)