mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-27 13:13:31 +00:00
Updated Rector to commit f24b01ae0af6cdf4517fee0d74d79cc39d31f602
f24b01ae0a
Remove CI status for rector/phpstan-rules on Readme (#5456) (#5458)
This commit is contained in:
parent
2b3879001d
commit
e61f4b3c7b
|
@ -6,6 +6,8 @@ namespace Rector\CodeQuality\Rector\Switch_;
|
||||||
use PhpParser\Node;
|
use PhpParser\Node;
|
||||||
use PhpParser\Node\Expr;
|
use PhpParser\Node\Expr;
|
||||||
use PhpParser\Node\Expr\BinaryOp\Identical;
|
use PhpParser\Node\Expr\BinaryOp\Identical;
|
||||||
|
use PhpParser\Node\Stmt;
|
||||||
|
use PhpParser\Node\Stmt\Break_;
|
||||||
use PhpParser\Node\Stmt\If_;
|
use PhpParser\Node\Stmt\If_;
|
||||||
use PhpParser\Node\Stmt\Switch_;
|
use PhpParser\Node\Stmt\Switch_;
|
||||||
use Rector\Rector\AbstractRector;
|
use Rector\Rector\AbstractRector;
|
||||||
|
@ -78,7 +80,10 @@ CODE_SAMPLE
|
||||||
$onlyCase = $node->cases[0];
|
$onlyCase = $node->cases[0];
|
||||||
// only default → basically unwrap
|
// only default → basically unwrap
|
||||||
if (!$onlyCase->cond instanceof Expr) {
|
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 = new If_(new Identical($node->cond, $onlyCase->cond));
|
||||||
$if->stmts = $this->switchManipulator->removeBreakNodes($onlyCase->stmts);
|
$if->stmts = $this->switchManipulator->removeBreakNodes($onlyCase->stmts);
|
||||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const PACKAGE_VERSION = '061ddc360ad8fcc5c237a77463d1d62a562c5d14';
|
public const PACKAGE_VERSION = 'f24b01ae0af6cdf4517fee0d74d79cc39d31f602';
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const RELEASE_DATE = '2024-01-10 22:09:50';
|
public const RELEASE_DATE = '2024-01-11 22:29:41';
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user