Updated Rector to commit c01925aad05a9baf0a44701a069a989ca3c0edc8

c01925aad0 Resolve native return-type from native union-type in short ternary (#4606)
This commit is contained in:
Tomas Votruba 2023-07-26 12:30:52 +00:00
parent 7287327bed
commit abd2958b1c
7 changed files with 23 additions and 18 deletions

View File

@ -15,6 +15,7 @@ use PHPStan\Type\TypeCombinator;
use PHPStan\Type\UnionType;
use Rector\Core\Rector\AbstractScopeAwareRector;
use Rector\Core\ValueObject\PhpVersionFeature;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
use Rector\TypeDeclaration\TypeInferer\ReturnTypeInferer;
use Rector\VendorLocker\NodeVendorLocker\ClassMethodReturnTypeOverrideGuard;
@ -90,7 +91,11 @@ CODE_SAMPLE
return null;
}
$ternary = $return->expr;
$nativeTernaryType = $scope->getNativeType($ternary);
$returnScope = $return->expr->getAttribute(AttributeKey::SCOPE);
if ($returnScope === null) {
return null;
}
$nativeTernaryType = $returnScope->getNativeType($ternary);
if ($nativeTernaryType instanceof MixedType) {
return null;
}

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '729f03b6e9abccb7c4d7a4515e4dfed61e725e71';
public const PACKAGE_VERSION = 'c01925aad05a9baf0a44701a069a989ca3c0edc8';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-07-25 16:46:02';
public const RELEASE_DATE = '2023-07-26 12:27:21';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitda61ac145fbc2d8a7bd7f0bf995e54c1::getLoader();
return ComposerAutoloaderInite0b3f28bb44c98e5afb2da9d4deed44a::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitda61ac145fbc2d8a7bd7f0bf995e54c1
class ComposerAutoloaderInite0b3f28bb44c98e5afb2da9d4deed44a
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInitda61ac145fbc2d8a7bd7f0bf995e54c1
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitda61ac145fbc2d8a7bd7f0bf995e54c1', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInite0b3f28bb44c98e5afb2da9d4deed44a', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitda61ac145fbc2d8a7bd7f0bf995e54c1', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInite0b3f28bb44c98e5afb2da9d4deed44a', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitda61ac145fbc2d8a7bd7f0bf995e54c1::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInite0b3f28bb44c98e5afb2da9d4deed44a::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitda61ac145fbc2d8a7bd7f0bf995e54c1::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInite0b3f28bb44c98e5afb2da9d4deed44a::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitda61ac145fbc2d8a7bd7f0bf995e54c1
class ComposerStaticInite0b3f28bb44c98e5afb2da9d4deed44a
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3022,9 +3022,9 @@ class ComposerStaticInitda61ac145fbc2d8a7bd7f0bf995e54c1
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitda61ac145fbc2d8a7bd7f0bf995e54c1::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitda61ac145fbc2d8a7bd7f0bf995e54c1::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitda61ac145fbc2d8a7bd7f0bf995e54c1::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInite0b3f28bb44c98e5afb2da9d4deed44a::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInite0b3f28bb44c98e5afb2da9d4deed44a::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInite0b3f28bb44c98e5afb2da9d4deed44a::$classMap;
}, null, ClassLoader::class);
}

View File

@ -504,8 +504,8 @@
},
{
"name": "illuminate\/container",
"version": "v10.16.0",
"version_normalized": "10.16.0.0",
"version": "v10.16.1",
"version_normalized": "10.16.1.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/illuminate\/container.git",
@ -558,8 +558,8 @@
},
{
"name": "illuminate\/contracts",
"version": "v10.16.0",
"version_normalized": "10.16.0.0",
"version": "v10.16.1",
"version_normalized": "10.16.1.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/illuminate\/contracts.git",

File diff suppressed because one or more lines are too long