mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-01 00:40:52 +00:00
Updated Rector to commit 0348124a5535b99712da4debc136d2e73647b97a
0348124a55
[CodeQuality] Skip Switch_ always returned on ExplicitReturnNullRector (#5800)
This commit is contained in:
parent
6e65fef1e7
commit
b352c8473a
|
@ -13,6 +13,7 @@ use PhpParser\Node\Expr\YieldFrom;
|
||||||
use PhpParser\Node\FunctionLike;
|
use PhpParser\Node\FunctionLike;
|
||||||
use PhpParser\Node\Stmt;
|
use PhpParser\Node\Stmt;
|
||||||
use PhpParser\Node\Stmt\Break_;
|
use PhpParser\Node\Stmt\Break_;
|
||||||
|
use PhpParser\Node\Stmt\Case_;
|
||||||
use PhpParser\Node\Stmt\ClassMethod;
|
use PhpParser\Node\Stmt\ClassMethod;
|
||||||
use PhpParser\Node\Stmt\Continue_;
|
use PhpParser\Node\Stmt\Continue_;
|
||||||
use PhpParser\Node\Stmt\Do_;
|
use PhpParser\Node\Stmt\Do_;
|
||||||
|
@ -149,8 +150,11 @@ final class SilentVoidResolver
|
||||||
return \false;
|
return \false;
|
||||||
}
|
}
|
||||||
$casesWithReturnOrExitCount = $this->resolveReturnOrExitCount($switch);
|
$casesWithReturnOrExitCount = $this->resolveReturnOrExitCount($switch);
|
||||||
|
$cases = \array_filter($switch->cases, static function (Case_ $case) : bool {
|
||||||
|
return $case->stmts !== [];
|
||||||
|
});
|
||||||
// has same amount of first return or exit nodes as switches
|
// has same amount of first return or exit nodes as switches
|
||||||
return \count($switch->cases) === $casesWithReturnOrExitCount;
|
return \count($cases) === $casesWithReturnOrExitCount;
|
||||||
}
|
}
|
||||||
private function isTryCatchAlwaysReturnOrExit(TryCatch $tryCatch) : bool
|
private function isTryCatchAlwaysReturnOrExit(TryCatch $tryCatch) : bool
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const PACKAGE_VERSION = '88648d1e6fe18bcc67ea76ebdc76c1d1e6d1fe6f';
|
public const PACKAGE_VERSION = '0348124a5535b99712da4debc136d2e73647b97a';
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const RELEASE_DATE = '2024-04-03 13:36:35';
|
public const RELEASE_DATE = '2024-04-03 21:15:24';
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user