Skip to content

Commit

Permalink
Updated Rector to commit 9d310ce5daca61f51f35e3c8755a442998f1c536
Browse files Browse the repository at this point in the history
rectorphp/rector-src@9d310ce Skip null type in ReturnTypeFromStrictScalarReturnExprRector as often not desired (#5462)
  • Loading branch information
TomasVotruba committed Jan 13, 2024
1 parent 6ab38a8 commit 455fba4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
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;
Expand Down Expand Up @@ -115,6 +116,10 @@ public function refactorWithScope(Node $node, Scope $scope) : ?Node
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;
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 455fba4

Please sign in to comment.