Skip to content

Commit 6af747a

Browse files
authored
Reuse RectorCheaperGuardsFirstRule from symplify/phpstan-rules (#8404)
1 parent b22371b commit 6af747a

8 files changed

Lines changed: 10 additions & 429 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"rector/swiss-knife": "^2.4.1",
5454
"shipmonk/composer-dependency-analyser": "^1.8",
5555
"symplify/easy-coding-standard": "^13.2.13",
56-
"symplify/phpstan-rules": "^14.12.3",
56+
"symplify/phpstan-rules": "^14.13",
5757
"tomasvotruba/class-leak": "^2.1",
5858
"tomasvotruba/fast-unit": "^0.1",
5959
"tomasvotruba/type-coverage": "^2.3.6",

phpstan.neon

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ includes:
33
- vendor/symplify/phpstan-rules/config/rector-rules.neon
44

55
rules:
6-
- Rector\Utils\PHPStan\Rule\CheaperGuardFirstRule
76
- Rector\Utils\PHPStan\Rule\RegisterRelatedPolyfillRectorRule
87

98
parameters:
@@ -71,6 +70,12 @@ parameters:
7170
message: '#deprecated (class|interface) Rector\\(Set|Bridge)\\#'
7271
path: src/Configuration/RectorConfigBuilder.php
7372

73+
# EARLY_RETURN set is deprecated (empty, merged into code-quality), still mapped internally until removed
74+
-
75+
identifier: classConstant.deprecated
76+
message: '#EARLY_RETURN of class Rector\\Set\\ValueObject\\SetList#'
77+
path: src/Configuration/RectorConfigBuilder.php
78+
7479
# the deprecated github/gitlab output formatters are still tested until removed in next minor version
7580
-
7681
identifier: new.deprecatedClass

src/Set/ValueObject/SetList.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ final class SetList
7575

7676
public const string TYPE_DECLARATION_DOCBLOCKS = __DIR__ . '/../../../config/set/type-declaration-docblocks.php';
7777

78+
/**
79+
* @deprecated Use code-quality set instead, as all early return rules were moved there
80+
*/
7881
public const string EARLY_RETURN = __DIR__ . '/../../../config/set/early-return.php';
7982

8083
public const string INSTANCEOF = __DIR__ . '/../../../config/set/instanceof.php';

utils/phpstan/src/Rule/CheaperGuardFirstRule.php

Lines changed: 0 additions & 274 deletions
This file was deleted.

utils/phpstan/tests/Rule/CheaperGuardFirstRule/CheaperGuardFirstRuleTest.php

Lines changed: 0 additions & 37 deletions
This file was deleted.

utils/phpstan/tests/Rule/CheaperGuardFirstRule/Source/CheapGuardFirstRector.php

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)