mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-13 20:36:23 +01:00
27 lines
477 B
PHP
27 lines
477 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 Break_) {
|
|
unset($stmts[$key]);
|
|
}
|
|
}
|
|
|
|
return $stmts;
|
|
}
|
|
}
|