mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 03:40:50 +00:00
[CodingStyle] Clean up spl_object_hash() check on NewlineAfterStatementRector (#2203)
This commit is contained in:
parent
6063b59cde
commit
e782cccb55
|
@ -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(
|
||||
|
@ -115,11 +110,6 @@ CODE_SAMPLE
|
|||
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;
|
||||
|
@ -155,7 +145,6 @@ CODE_SAMPLE
|
|||
}
|
||||
}
|
||||
|
||||
$this->stmtsHashed[$hash] = true;
|
||||
$this->nodesToAddCollector->addNodeAfterNode(new Nop(), $node);
|
||||
|
||||
return $node;
|
||||
|
|
Loading…
Reference in New Issue
Block a user