mirror of
https://github.com/rectorphp/rector.git
synced 2024-09-01 05:10:14 +00:00
Updated Rector to commit a3bc2dcf8045157aafb20645b9e3cf49fa0542fb
a3bc2dcf80
[TypeDeclaration] Handle crash Multiple variants - use selectFromArgs() on ReturnAnnotationIncorrectNullableRector (#3359)
This commit is contained in:
parent
3b73a69c61
commit
73d7bba3b0
@ -20,7 +20,11 @@ final class ParametersAcceptorSelectorVariantsWrapper
|
||||
{
|
||||
$variants = $reflection->getVariants();
|
||||
if ($node instanceof FunctionLike) {
|
||||
return ParametersAcceptorSelector::selectSingle($variants);
|
||||
$parameterAcceptors = [];
|
||||
foreach ($variants as $variant) {
|
||||
$parameterAcceptors[] = ParametersAcceptorSelector::selectSingle([$variant]);
|
||||
}
|
||||
return ParametersAcceptorSelector::combineAcceptors($parameterAcceptors);
|
||||
}
|
||||
if ($node->isFirstClassCallable()) {
|
||||
return ParametersAcceptorSelector::selectSingle($variants);
|
||||
|
@ -7,10 +7,10 @@ use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PhpParser\Node\Stmt\Return_;
|
||||
use PHPStan\Analyser\Scope;
|
||||
use PHPStan\Reflection\ClassReflection;
|
||||
use PHPStan\Reflection\FunctionVariantWithPhpDocs;
|
||||
use PHPStan\Reflection\MethodReflection;
|
||||
use PHPStan\Reflection\ParametersAcceptorSelector;
|
||||
use PHPStan\Reflection\ReflectionProvider;
|
||||
use PHPStan\Type\MixedType;
|
||||
use PHPStan\Type\Type;
|
||||
@ -21,6 +21,8 @@ use Rector\Core\PhpParser\Node\BetterNodeFinder;
|
||||
use Rector\Core\Reflection\ReflectionResolver;
|
||||
use Rector\FamilyTree\Reflection\FamilyRelationsAnalyzer;
|
||||
use Rector\NodeNameResolver\NodeNameResolver;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\NodeTypeResolver\PHPStan\ParametersAcceptorSelectorVariantsWrapper;
|
||||
use Rector\TypeDeclaration\TypeInferer\ReturnTypeInferer;
|
||||
use Rector\VendorLocker\ParentClassMethodTypeOverrideGuard;
|
||||
final class ClassMethodReturnTypeOverrideGuard
|
||||
@ -123,7 +125,11 @@ final class ClassMethodReturnTypeOverrideGuard
|
||||
if (!$parentClassMethodReflection instanceof MethodReflection) {
|
||||
return \true;
|
||||
}
|
||||
$parametersAcceptor = ParametersAcceptorSelector::selectSingle($parentClassMethodReflection->getVariants());
|
||||
$scope = $classMethod->getAttribute(AttributeKey::SCOPE);
|
||||
if (!$scope instanceof Scope) {
|
||||
return \false;
|
||||
}
|
||||
$parametersAcceptor = ParametersAcceptorSelectorVariantsWrapper::select($parentClassMethodReflection, $classMethod, $scope);
|
||||
if ($parametersAcceptor instanceof FunctionVariantWithPhpDocs && !$parametersAcceptor->getNativeReturnType() instanceof MixedType) {
|
||||
return \false;
|
||||
}
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'b999639103204532273571a43e9a9d1b19ea4ff2';
|
||||
public const PACKAGE_VERSION = 'a3bc2dcf8045157aafb20645b9e3cf49fa0542fb';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-02-08 09:12:42';
|
||||
public const RELEASE_DATE = '2023-02-08 09:14:25';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInite8ed5ec3e72a8475b38336ca410a2b43::getLoader();
|
||||
return ComposerAutoloaderInit6a31b70255335038789a0563cb43e5af::getLoader();
|
||||
|
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInite8ed5ec3e72a8475b38336ca410a2b43
|
||||
class ComposerAutoloaderInit6a31b70255335038789a0563cb43e5af
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInite8ed5ec3e72a8475b38336ca410a2b43
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInite8ed5ec3e72a8475b38336ca410a2b43', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit6a31b70255335038789a0563cb43e5af', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInite8ed5ec3e72a8475b38336ca410a2b43', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit6a31b70255335038789a0563cb43e5af', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInite8ed5ec3e72a8475b38336ca410a2b43::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit6a31b70255335038789a0563cb43e5af::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInite8ed5ec3e72a8475b38336ca410a2b43::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit6a31b70255335038789a0563cb43e5af::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInite8ed5ec3e72a8475b38336ca410a2b43
|
||||
class ComposerStaticInit6a31b70255335038789a0563cb43e5af
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3097,9 +3097,9 @@ class ComposerStaticInite8ed5ec3e72a8475b38336ca410a2b43
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInite8ed5ec3e72a8475b38336ca410a2b43::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInite8ed5ec3e72a8475b38336ca410a2b43::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInite8ed5ec3e72a8475b38336ca410a2b43::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit6a31b70255335038789a0563cb43e5af::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit6a31b70255335038789a0563cb43e5af::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit6a31b70255335038789a0563cb43e5af::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user