Skip to content

Commit

Permalink
(fix) RemoveDoubleAssignRector: properly skip if the assigned express…
Browse files Browse the repository at this point in the history
…ion is a call (#5191)
  • Loading branch information
j2L4e authored Jan 15, 2021
1 parent 96986b5 commit deafb51
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function refactor(Node $node): ?Node
return null;
}

if ($this->isCall($node->expr)) {
if ($this->isCall($previousStatement->expr->expr)) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,24 @@ class SkipCalls
$item = array_pop($items);
$item = array_pop($items);
$item = array_pop($items);
$item = null;
}

public function staticCalls()
{
$item = StaticClass::dump();
$item = StaticClass::dump();
$item = StaticClass::dump();
$item = null;
}

public function nonStaticCalls()
{
$nonStaticClass = (new NonStaticClass());
$item = $nonStaticClass->dump();
$item = $nonStaticClass->dump();
$item = $nonStaticClass->dump();
$item = null;
}
}

Expand Down

0 comments on commit deafb51

Please sign in to comment.