File tree Expand file tree Collapse file tree 3 files changed +13
-12
lines changed
rules/DowngradePhp85/Rector/StmtsAwareInterface Expand file tree Collapse file tree 3 files changed +13
-12
lines changed Original file line number Diff line number Diff line change 1212 "phpstan/phpstan-webmozart-assert" : " ^2.0" ,
1313 "phpunit/phpunit" : " ^11.5" ,
1414 "rector/rector-src" : " dev-main" ,
15+ "rector/type-perfect" : " ^2.1" ,
1516 "symplify/easy-coding-standard" : " ^12.3" ,
1617 "symplify/phpstan-extensions" : " ^12.0" ,
1718 "symplify/phpstan-rules" : " ^14.9" ,
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ parameters:
66 level : 8
77 errorFormat : symplify
88
9- reportUnmatchedIgnoredErrors : false
9+ # reportUnmatchedIgnoredErrors: false
1010
1111 # see https://phpstan.org/writing-php-code/phpdoc-types#global-type-aliases
1212 typeAliases :
@@ -31,12 +31,11 @@ parameters:
3131 - '*/Source/*'
3232
3333 # see https://github.com/rectorphp/type-perfect/
34- # to be enabled later once rector upgraded to use phpstan v2
35- # type_perfect:
36- # no_mixed: true
37- # null_over_false: true
38- # narrow_param: true
39- # narrow_return: true
34+ type_perfect :
35+ no_mixed : true
36+ null_over_false : true
37+ narrow_param : true
38+ narrow_return : true
4039
4140 ignoreErrors :
4241 # php enum value minus
Original file line number Diff line number Diff line change 55namespace Rector \DowngradePhp85 \Rector \StmtsAwareInterface ;
66
77use PhpParser \Node ;
8+ use PhpParser \Node \Expr ;
89use PhpParser \Node \Expr \ArrowFunction ;
910use PhpParser \Node \Expr \Assign ;
1011use PhpParser \Node \Expr \BinaryOp \Pipe ;
@@ -104,14 +105,14 @@ public function refactor(Node $node): ?Node
104105 return $ hasChanged ? $ node : null ;
105106 }
106107
107- private function findPipeNode (Node $ node ): ?Pipe
108+ private function findPipeNode (Expr $ expr ): ?Pipe
108109 {
109- if ($ node instanceof Pipe) {
110- return $ node ;
110+ if ($ expr instanceof Pipe) {
111+ return $ expr ;
111112 }
112113
113- if ($ node instanceof Assign && $ node ->expr instanceof Pipe) {
114- return $ node ->expr ;
114+ if ($ expr instanceof Assign && $ expr ->expr instanceof Pipe) {
115+ return $ expr ->expr ;
115116 }
116117
117118 return null ;
You can’t perform that action at this time.
0 commit comments