Updated Rector to commit 690fe892750028e239a01f1b13cd252359994522

690fe89275 [CodeQuality] Skip Always return in try catch with finally on ExplicitReturnNullRector (#5807)
This commit is contained in:
Tomas Votruba 2024-04-07 09:15:50 +00:00
parent 530c01c201
commit 6fb3352189
2 changed files with 11 additions and 6 deletions

View File

@ -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)) {
return \false;
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
{

View File

@ -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
*/