rector/rules/Renaming/NodeManipulator/SwitchManipulator.php
Tomas Votruba d56e7982d0 Updated Rector to commit dedd4b55fe3e03cae9bd5ac822cfdccd8deb3fb6
dedd4b55fe make node_helper.php safe for similar names
2021-05-09 20:15:43 +00:00

24 lines
497 B
PHP

<?php
declare (strict_types=1);
namespace Rector\Renaming\NodeManipulator;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Break_;
final class SwitchManipulator
{
/**
* @param Stmt[] $stmts
* @return Stmt[]
*/
public function removeBreakNodes(array $stmts) : array
{
foreach ($stmts as $key => $node) {
if ($node instanceof \PhpParser\Node\Stmt\Break_) {
unset($stmts[$key]);
}
}
return $stmts;
}
}