Updated Rector to commit f24b01ae0af6cdf4517fee0d74d79cc39d31f602

f24b01ae0a Remove CI status for rector/phpstan-rules on Readme (#5456) (#5458)
This commit is contained in:
Tomas Votruba 2024-01-11 15:31:55 +00:00
parent 2b3879001d
commit e61f4b3c7b
2 changed files with 8 additions and 3 deletions

View File

@ -6,6 +6,8 @@ namespace Rector\CodeQuality\Rector\Switch_;
use PhpParser\Node;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\BinaryOp\Identical;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Break_;
use PhpParser\Node\Stmt\If_;
use PhpParser\Node\Stmt\Switch_;
use Rector\Rector\AbstractRector;
@ -78,7 +80,10 @@ CODE_SAMPLE
$onlyCase = $node->cases[0];
// only default → basically unwrap
if (!$onlyCase->cond instanceof Expr) {
return $onlyCase->stmts;
// remove default clause because it cause syntax error
return \array_filter($onlyCase->stmts, function (Stmt $statement) {
return !$statement instanceof Break_;
});
}
$if = new If_(new Identical($node->cond, $onlyCase->cond));
$if->stmts = $this->switchManipulator->removeBreakNodes($onlyCase->stmts);

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '061ddc360ad8fcc5c237a77463d1d62a562c5d14';
public const PACKAGE_VERSION = 'f24b01ae0af6cdf4517fee0d74d79cc39d31f602';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-01-10 22:09:50';
public const RELEASE_DATE = '2024-01-11 22:29:41';
/**
* @var int
*/