Updated Rector to commit 5363a676265cbe868f4ecc6bde8c6a99b213d028

5363a67626 AddReturnTypeDeclarationBasedOnParentClassMethodRector: don't trust phpdoc types (#4810)
This commit is contained in:
Tomas Votruba 2023-08-17 15:17:47 +00:00
parent df751a94e8
commit 7ad16ccd68
5 changed files with 19 additions and 13 deletions

View File

@ -8,6 +8,8 @@ use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassMethod;
use PHPStan\Reflection\MethodReflection;
use PHPStan\Reflection\ParametersAcceptorSelector;
use PHPStan\Reflection\ParametersAcceptorWithPhpDocs;
use PHPStan\Reflection\Php\PhpMethodReflection;
use PHPStan\Type\MixedType;
use PHPStan\Type\ObjectType;
use PHPStan\Type\Type;
@ -120,7 +122,11 @@ CODE_SAMPLE
if ($parentMethodReflection->isPrivate()) {
return null;
}
$parentReturnType = ParametersAcceptorSelector::selectSingle($parentMethodReflection->getVariants())->getReturnType();
$parameterAcceptor = ParametersAcceptorSelector::selectSingle($parentMethodReflection->getVariants());
if (!$parameterAcceptor instanceof ParametersAcceptorWithPhpDocs) {
return null;
}
$parentReturnType = $parameterAcceptor->getNativeReturnType();
if (!$parentReturnType instanceof MixedType) {
return $parentReturnType;
}

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '8d74e1c8c249ba279dfaaf714d8b43aa41b55a7c';
public const PACKAGE_VERSION = '5363a676265cbe868f4ecc6bde8c6a99b213d028';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-08-17 21:58:01';
public const RELEASE_DATE = '2023-08-17 17:14:55';
/**
* @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 ComposerAutoloaderInit50141edddb7254c3c329223e24b5b4dd::getLoader();
return ComposerAutoloaderInit18213625cfe26e077a3b667c79f3c331::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit50141edddb7254c3c329223e24b5b4dd
class ComposerAutoloaderInit18213625cfe26e077a3b667c79f3c331
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInit50141edddb7254c3c329223e24b5b4dd
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit50141edddb7254c3c329223e24b5b4dd', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit18213625cfe26e077a3b667c79f3c331', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit50141edddb7254c3c329223e24b5b4dd', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit18213625cfe26e077a3b667c79f3c331', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit50141edddb7254c3c329223e24b5b4dd::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit18213625cfe26e077a3b667c79f3c331::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit50141edddb7254c3c329223e24b5b4dd::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit18213625cfe26e077a3b667c79f3c331::$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 ComposerStaticInit50141edddb7254c3c329223e24b5b4dd
class ComposerStaticInit18213625cfe26e077a3b667c79f3c331
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -2639,9 +2639,9 @@ class ComposerStaticInit50141edddb7254c3c329223e24b5b4dd
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit50141edddb7254c3c329223e24b5b4dd::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit50141edddb7254c3c329223e24b5b4dd::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit50141edddb7254c3c329223e24b5b4dd::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit18213625cfe26e077a3b667c79f3c331::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit18213625cfe26e077a3b667c79f3c331::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit18213625cfe26e077a3b667c79f3c331::$classMap;
}, null, ClassLoader::class);
}