mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-30 16:00:52 +00:00
Updated Rector to commit 9d310ce5daca61f51f35e3c8755a442998f1c536
9d310ce5da
Skip null type in ReturnTypeFromStrictScalarReturnExprRector as often not desired (#5462)
This commit is contained in:
parent
6ab38a869f
commit
455fba49f9
|
@ -9,6 +9,7 @@ use PhpParser\Node\Stmt\ClassMethod;
|
|||
use PhpParser\Node\Stmt\Function_;
|
||||
use PhpParser\Node\UnionType;
|
||||
use PHPStan\Analyser\Scope;
|
||||
use PHPStan\Type\NullType;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\Contract\Rector\ConfigurableRectorInterface;
|
||||
use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
|
||||
|
@ -115,6 +116,10 @@ CODE_SAMPLE
|
|||
if (!$scalarReturnType instanceof Type) {
|
||||
return null;
|
||||
}
|
||||
// skip null as often placeholder value and not an only type
|
||||
if ($scalarReturnType instanceof NullType) {
|
||||
return null;
|
||||
}
|
||||
$returnTypeNode = $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode($scalarReturnType, TypeKind::RETURN);
|
||||
if (!$returnTypeNode instanceof Node) {
|
||||
return null;
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '2ac26e77e63664f3e250af12f021696c60ca0df4';
|
||||
public const PACKAGE_VERSION = '9d310ce5daca61f51f35e3c8755a442998f1c536';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-01-13 08:49:04';
|
||||
public const RELEASE_DATE = '2024-01-13 09:41:12';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user