Skip to content

Commit

Permalink
[CodingStyle] Clean up spl_object_hash() check on NewlineAfterStateme…
Browse files Browse the repository at this point in the history
…ntRector (#2203)
  • Loading branch information
samsonasik committed Apr 30, 2022
1 parent 6063b59 commit e782ccc
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions rules/CodingStyle/Rector/Stmt/NewlineAfterStatementRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ final class NewlineAfterStatementRector extends AbstractRector
Switch_::class,
];

/**
* @var array<string, true>
*/
private array $stmtsHashed = [];

public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition(
Expand Down Expand Up @@ -115,11 +110,6 @@ public function refactor(Node $node): ?Node
return null;
}

$hash = spl_object_hash($node);
if (isset($this->stmtsHashed[$hash])) {
return null;
}

$nextNode = $node->getAttribute(AttributeKey::NEXT_NODE);
if (! $nextNode instanceof Node) {
return null;
Expand Down Expand Up @@ -155,7 +145,6 @@ public function refactor(Node $node): ?Node
}
}

$this->stmtsHashed[$hash] = true;
$this->nodesToAddCollector->addNodeAfterNode(new Nop(), $node);

return $node;
Expand Down

0 comments on commit e782ccc

Please sign in to comment.