Skip to content

Commit c9aabad

Browse files
committed
static fixes
1 parent 1de17f9 commit c9aabad

File tree

5 files changed

+28
-5
lines changed

5 files changed

+28
-5
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"phpunit/phpunit": "^11.5",
1414
"rector/rector-src": "dev-main",
1515
"symplify/easy-coding-standard": "^12.3",
16+
"symplify/phpstan-extensions": "^12.0",
1617
"symplify/phpstan-rules": "^14.9",
1718
"symplify/rule-doc-generator": "^12.2",
1819
"symplify/vendor-patches": "^11.5",

phpstan.neon

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ includes:
44

55
parameters:
66
level: 8
7+
errorFormat: symplify
78

89
reportUnmatchedIgnoredErrors: false
910

@@ -75,3 +76,26 @@ parameters:
7576
-
7677
identifier: deadCode.unreachable
7778
path: rules/DowngradePhp80/Rector/NullsafeMethodCall/DowngradeNullsafeToTernaryOperatorRector.php
79+
80+
# cached printed nodes
81+
-
82+
identifier: rector.noPropertyNodeAssign
83+
paths:
84+
- rules/DowngradePhp83/Rector/FuncCall/DowngradeJsonValidateRector.php
85+
- rules/DowngradePhp81/Rector/FuncCall/DowngradeArrayIsListRector.php
86+
- rules/DowngradePhp72/Rector/FuncCall/DowngradeStreamIsattyRector.php
87+
88+
# already registered in PHP 8.1 set
89+
-
90+
identifier: rector.upgradeDowngradeRegisteredInSet
91+
path: rules/DowngradePhp74/Rector/Array_/DowngradeArraySpreadRector.php
92+
93+
# valid stmts property check
94+
-
95+
identifier: symplify.forbiddenFuncCall
96+
path: rules/DowngradePhp73/Rector/FuncCall/DowngradeArrayKeyFirstLastRector.php
97+
98+
# false positive
99+
-
100+
identifier: symplify.seeAnnotationToTest
101+
path: rules/DowngradePhp85/Rector/StmtsAwareInterface/DowngradePipeOperatorRector.php

rules/DowngradePhp73/Rector/FuncCall/DowngradeArrayKeyFirstLastRector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ public function run($items)
8080
*/
8181
public function getNodeTypes(): array
8282
{
83-
$stmtsAware = NodeGroup::STMTS_AWARE;
84-
return [...$stmtsAware, Switch_::class, Return_::class, Expression::class, Echo_::class];
83+
return [...NodeGroup::STMTS_AWARE, Switch_::class, Return_::class, Expression::class, Echo_::class];
8584
}
8685

8786
/**

rules/DowngradePhp81/Rector/FuncCall/DowngradeHashAlgorithmXxHashRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
final class DowngradeHashAlgorithmXxHashRector extends AbstractRector
3333
{
3434
/**
35-
* @var array<string, string>
35+
* @var array<string, int>
3636
*/
3737
private const HASH_ALGORITHMS_TO_DOWNGRADE = [
3838
'xxh32' => MHASH_XXH32,

rules/DowngradePhp85/Rector/StmtsAwareInterface/DowngradePipeOperatorRector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
2222

2323
/**
24-
* @see https://wiki.php.net/rfc/pipe-operator-v3
25-
*
2624
* @see \Rector\Tests\DowngradePhp85\Rector\StmtsAwareInterface\DowngradePipeOperatorRector\DowngradePipeOperatorRectorTest
25+
* @see https://wiki.php.net/rfc/pipe-operator-v3
2726
*/
2827
final class DowngradePipeOperatorRector extends AbstractRector
2928
{

0 commit comments

Comments
 (0)