Skip to content

Commit e630a6e

Browse files
committed
feedback
1 parent 5c64490 commit e630a6e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

rules/Php85/Rector/StmtsAwareInterface/NestedToPipeOperatorRector.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)