mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-20 07:22:43 +02:00
Updated Rector to commit 5da2f3302522508e64b7b74e649f06e45f7b70db
5da2f33025
[TypeDeclaration] Clean up never type check on AddNeverReturnType (#6304)
This commit is contained in:
parent
a205fb67bd
commit
056f7047c7
@ -71,6 +71,8 @@ final class AddNeverReturnType
|
||||
*/
|
||||
private function shouldSkip($node, Scope $scope) : bool
|
||||
{
|
||||
// already has return type, and non-void
|
||||
// it can be "never" return itself, or other return type
|
||||
if ($node->returnType instanceof Node && !$this->nodeNameResolver->isName($node->returnType, 'void')) {
|
||||
return \true;
|
||||
}
|
||||
@ -87,10 +89,7 @@ final class AddNeverReturnType
|
||||
return \false;
|
||||
}
|
||||
// skip as most likely intentional
|
||||
if (!$this->classModifierChecker->isInsideFinalClass($node) && $this->nodeNameResolver->isName($node->returnType, 'void')) {
|
||||
return \true;
|
||||
}
|
||||
return $this->nodeNameResolver->isName($node->returnType, 'never');
|
||||
return !$this->classModifierChecker->isInsideFinalClass($node) && $this->nodeNameResolver->isName($node->returnType, 'void');
|
||||
}
|
||||
/**
|
||||
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Expr\Closure $node
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'dd93b38091aa7f5ff5ba15791f49d86059cd1ef8';
|
||||
public const PACKAGE_VERSION = '5da2f3302522508e64b7b74e649f06e45f7b70db';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-09-15 00:33:52';
|
||||
public const RELEASE_DATE = '2024-09-15 08:12:52';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user