mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-05 02:40:50 +00:00
Updated Rector to commit 690fe892750028e239a01f1b13cd252359994522
690fe89275
[CodeQuality] Skip Always return in try catch with finally on ExplicitReturnNullRector (#5807)
This commit is contained in:
parent
530c01c201
commit
6fb3352189
|
@ -158,15 +158,20 @@ final class SilentVoidResolver
|
|||
}
|
||||
private function isTryCatchAlwaysReturnOrExit(TryCatch $tryCatch) : bool
|
||||
{
|
||||
$hasReturnOrExitInFinally = $tryCatch->finally instanceof Finally_ && $this->hasStmtsAlwaysReturnOrExit($tryCatch->finally->stmts);
|
||||
if (!$this->hasStmtsAlwaysReturnOrExit($tryCatch->stmts)) {
|
||||
return \false;
|
||||
return $hasReturnOrExitInFinally;
|
||||
}
|
||||
foreach ($tryCatch->catches as $catch) {
|
||||
if (!$this->hasStmtsAlwaysReturnOrExit($catch->stmts)) {
|
||||
if ($this->hasStmtsAlwaysReturnOrExit($catch->stmts)) {
|
||||
continue;
|
||||
}
|
||||
if ($hasReturnOrExitInFinally) {
|
||||
continue;
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
}
|
||||
return !($tryCatch->finally instanceof Finally_ && !$this->hasStmtsAlwaysReturnOrExit($tryCatch->finally->stmts));
|
||||
return \true;
|
||||
}
|
||||
private function resolveReturnOrExitCount(Switch_ $switch) : int
|
||||
{
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '145b616765b9c534e5ebe4203caa0c0f4dd3b7fc';
|
||||
public const PACKAGE_VERSION = '690fe892750028e239a01f1b13cd252359994522';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-04-07 00:29:00';
|
||||
public const RELEASE_DATE = '2024-04-07 16:13:24';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user