File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
rules/Php85/Rector/StmtsAwareInterface Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -67,9 +67,12 @@ public function provideMinPhpVersion(): int
6767 return PhpVersionFeature::PIPE_OPERATOER ;
6868 }
6969
70+ /**
71+ * @param StmtsAwareInterface $node
72+ */
7073 public function refactor (Node $ node ): ?Node
7174 {
72- if (! $ node instanceof StmtsAwareInterface || $ node ->stmts === null ) {
75+ if ($ node ->stmts === null ) {
7376 return null ;
7477 }
7578
@@ -90,17 +93,18 @@ public function refactor(Node $node): ?Node
9093 return $ hasChanged ? $ node : null ;
9194 }
9295
93- private function transformSequentialAssignments (StmtsAwareInterface $ node ): bool
96+ private function transformSequentialAssignments (StmtsAwareInterface $ stmtsAware ): bool
9497 {
9598 $ hasChanged = false ;
96- $ statements = $ node ->stmts ;
99+
100+ $ statements = $ stmtsAware ->stmts ;
97101 $ totalStatements = count ($ statements ) - 1 ;
98102
99103 for ($ i = 0 ; $ i < $ totalStatements ; ++$ i ) {
100104 $ chain = $ this ->findAssignmentChain ($ statements , $ i );
101105
102106 if ($ chain && count ($ chain ) >= 2 ) {
103- $ this ->processAssignmentChain ($ node , $ chain , $ i );
107+ $ this ->processAssignmentChain ($ stmtsAware , $ chain , $ i );
104108 $ hasChanged = true ;
105109 // Skip processed statements
106110 $ i += count ($ chain ) - 1 ;
You can’t perform that action at this time.
0 commit comments