Updated Rector to commit 71c22e20d9a3b2ba187515711b13fca40b595d93

71c22e20d9 [CodeQuality] Skip with else on SimplifyForeachToCoalescingRector (#5307)
This commit is contained in:
Tomas Votruba 2023-12-02 04:51:32 +00:00
parent 971392df51
commit cb8a63ca31
2 changed files with 6 additions and 2 deletions

View File

@ -10,6 +10,7 @@ use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Expr\BinaryOp\Coalesce;
use PhpParser\Node\Expr\BinaryOp\Identical;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Else_;
use PhpParser\Node\Stmt\Expression;
use PhpParser\Node\Stmt\Foreach_;
use PhpParser\Node\Stmt\If_;
@ -125,6 +126,9 @@ CODE_SAMPLE
if (\count($if->stmts) !== 1) {
return null;
}
if ($if->else instanceof Else_ || $if->elseifs !== []) {
return null;
}
$innerStmt = $if->stmts[0];
if ($innerStmt instanceof Return_) {
return $innerStmt;

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '17397d5aecee91cdb525a1e1b012718a101cf4be';
public const PACKAGE_VERSION = '71c22e20d9a3b2ba187515711b13fca40b595d93';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-12-02 11:27:01';
public const RELEASE_DATE = '2023-12-02 11:49:23';
/**
* @var int
*/