Updated Rector to commit 25e6b17a86

25e6b17a86 Remove USE_NODES from ObjectTypeSpecifier::matchShortenedObjectType() (#2164)
This commit is contained in:
Tomas Votruba 2022-04-25 10:15:48 +00:00
parent d931048bad
commit 18c61e765a
11 changed files with 39 additions and 33 deletions

View File

@ -3,6 +3,7 @@
declare (strict_types=1);
namespace Rector\StaticTypeMapper\PhpDocParser;
use RectorPrefix20220425\Nette\Utils\Strings;
use PhpParser\Node;
use PhpParser\Node\Stmt\ClassLike;
use PHPStan\Analyser\NameScope;
@ -22,6 +23,7 @@ use Rector\NodeNameResolver\NodeNameResolver;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\StaticTypeMapper\Contract\PhpDocParser\PhpDocTypeMapperInterface;
use Rector\StaticTypeMapper\Mapper\ScalarStringToTypeMapper;
use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType;
use Rector\StaticTypeMapper\ValueObject\Type\ParentStaticType;
use Rector\StaticTypeMapper\ValueObject\Type\SelfObjectType;
use Rector\TypeDeclaration\PHPStan\Type\ObjectTypeSpecifier;
@ -95,7 +97,13 @@ final class IdentifierTypeMapper implements \Rector\StaticTypeMapper\Contract\Ph
if ($loweredName === 'iterable') {
return new \PHPStan\Type\IterableType(new \PHPStan\Type\MixedType(), new \PHPStan\Type\MixedType());
}
$objectType = new \PHPStan\Type\ObjectType($typeNode->name);
if (\strncmp($typeNode->name, '\\', \strlen('\\')) === 0) {
$type = $typeNode->name;
$typeWithoutPreslash = \RectorPrefix20220425\Nette\Utils\Strings::substring($type, 1);
$objectType = new \Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType($typeWithoutPreslash);
} else {
$objectType = new \PHPStan\Type\ObjectType($typeNode->name);
}
$scope = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE);
return $this->objectTypeSpecifier->narrowToFullyQualifiedOrAliasedObjectType($node, $objectType, $scope);
}

View File

@ -7,7 +7,6 @@ use RectorPrefix20220425\Nette\Utils\Strings;
use PhpParser\Node;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Stmt\Use_;
use PhpParser\Node\Stmt\UseUse;
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\ClassReflection;
@ -56,7 +55,7 @@ final class ObjectTypeSpecifier
*/
public function narrowToFullyQualifiedOrAliasedObjectType(\PhpParser\Node $node, \PHPStan\Type\ObjectType $objectType, $scope)
{
/** @var Use_[]|null $uses */
// this change will break \Rector\Tests\NodeTypeResolver\PerNodeTypeResolver\ParamTypeResolver\ParamTypeResolverTest
$uses = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::USE_NODES);
if ($uses === null) {
return $objectType;
@ -136,9 +135,8 @@ final class ObjectTypeSpecifier
*/
private function matchShortenedObjectType(\PhpParser\Node $node, \PHPStan\Type\ObjectType $objectType)
{
/** @var Use_[]|null $uses */
$uses = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::USE_NODES);
if ($uses === null) {
$uses = $this->useImportsResolver->resolveForNode($node);
if ($uses === []) {
return null;
}
foreach ($uses as $use) {

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '4b0d9e2c3dbedf77961e4891822238b01cc3cc07';
public const PACKAGE_VERSION = '25e6b17a862a90d6f67baaba3f164a31d039d3d7';
/**
* @var string
*/
public const RELEASE_DATE = '2022-04-25 09:00:58';
public const RELEASE_DATE = '2022-04-25 10:07:31';
/**
* @var string
*/

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitc8c46f75e093f0716bd0392dfdff8a01
class ComposerAutoloaderInit24361428587464401adaac6b98a43b76
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInitc8c46f75e093f0716bd0392dfdff8a01
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitc8c46f75e093f0716bd0392dfdff8a01', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit24361428587464401adaac6b98a43b76', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitc8c46f75e093f0716bd0392dfdff8a01', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit24361428587464401adaac6b98a43b76', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitc8c46f75e093f0716bd0392dfdff8a01::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit24361428587464401adaac6b98a43b76::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInitc8c46f75e093f0716bd0392dfdff8a01::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit24361428587464401adaac6b98a43b76::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequirec8c46f75e093f0716bd0392dfdff8a01($fileIdentifier, $file);
composerRequire24361428587464401adaac6b98a43b76($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInitc8c46f75e093f0716bd0392dfdff8a01
* @param string $file
* @return void
*/
function composerRequirec8c46f75e093f0716bd0392dfdff8a01($fileIdentifier, $file)
function composerRequire24361428587464401adaac6b98a43b76($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 ComposerStaticInitc8c46f75e093f0716bd0392dfdff8a01
class ComposerStaticInit24361428587464401adaac6b98a43b76
{
public static $files = array (
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@ -3872,9 +3872,9 @@ class ComposerStaticInitc8c46f75e093f0716bd0392dfdff8a01
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitc8c46f75e093f0716bd0392dfdff8a01::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitc8c46f75e093f0716bd0392dfdff8a01::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitc8c46f75e093f0716bd0392dfdff8a01::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit24361428587464401adaac6b98a43b76::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit24361428587464401adaac6b98a43b76::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit24361428587464401adaac6b98a43b76::$classMap;
}, null, ClassLoader::class);
}

View File

@ -2767,12 +2767,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/sabbelasichon\/typo3-rector.git",
"reference": "f33fd98a45dcdb4e24c7f655ccb4b63dd1043f81"
"reference": "55acf81c3878313e159537b578e35e7ef727d635"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/sabbelasichon\/typo3-rector\/zipball\/f33fd98a45dcdb4e24c7f655ccb4b63dd1043f81",
"reference": "f33fd98a45dcdb4e24c7f655ccb4b63dd1043f81",
"url": "https:\/\/api.github.com\/repos\/sabbelasichon\/typo3-rector\/zipball\/55acf81c3878313e159537b578e35e7ef727d635",
"reference": "55acf81c3878313e159537b578e35e7ef727d635",
"shasum": ""
},
"require": {
@ -2792,7 +2792,7 @@
"phpunit\/phpunit": "^9.5",
"rector\/phpstan-rules": "^0.4.20",
"rector\/rector-generator": "dev-main",
"rector\/rector-src": "dev-main",
"rector\/rector-src": "dev-main#b96e692",
"symfony\/console": "^6.0",
"symplify\/coding-standard": "^10.2",
"symplify\/easy-coding-standard": "^10.2",
@ -2802,7 +2802,7 @@
"symplify\/vendor-patches": "^10.2",
"tracy\/tracy": "^2.8"
},
"time": "2022-04-24T22:20:32+00:00",
"time": "2022-04-25T09:55:02+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main dc4fbb8'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 3f5c267'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 5d945fb'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main b794171'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 0c547b2'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 01fa90c'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main a9d0d93'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9f704d1'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main f33fd98'));
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main dc4fbb8'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 3f5c267'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 5d945fb'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main b794171'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 0c547b2'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 01fa90c'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main a9d0d93'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9f704d1'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 55acf81'));
private function __construct()
{
}

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20220425\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInitc8c46f75e093f0716bd0392dfdff8a01', false) && !interface_exists('ComposerAutoloaderInitc8c46f75e093f0716bd0392dfdff8a01', false) && !trait_exists('ComposerAutoloaderInitc8c46f75e093f0716bd0392dfdff8a01', false)) {
spl_autoload_call('RectorPrefix20220425\ComposerAutoloaderInitc8c46f75e093f0716bd0392dfdff8a01');
if (!class_exists('ComposerAutoloaderInit24361428587464401adaac6b98a43b76', false) && !interface_exists('ComposerAutoloaderInit24361428587464401adaac6b98a43b76', false) && !trait_exists('ComposerAutoloaderInit24361428587464401adaac6b98a43b76', false)) {
spl_autoload_call('RectorPrefix20220425\ComposerAutoloaderInit24361428587464401adaac6b98a43b76');
}
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20220425\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -59,9 +59,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20220425\print_node(...func_get_args());
}
}
if (!function_exists('composerRequirec8c46f75e093f0716bd0392dfdff8a01')) {
function composerRequirec8c46f75e093f0716bd0392dfdff8a01() {
return \RectorPrefix20220425\composerRequirec8c46f75e093f0716bd0392dfdff8a01(...func_get_args());
if (!function_exists('composerRequire24361428587464401adaac6b98a43b76')) {
function composerRequire24361428587464401adaac6b98a43b76() {
return \RectorPrefix20220425\composerRequire24361428587464401adaac6b98a43b76(...func_get_args());
}
}
if (!function_exists('scanPath')) {

View File

@ -30,7 +30,7 @@
"phpunit\/phpunit": "^9.5",
"rector\/phpstan-rules": "^0.4.20",
"rector\/rector-generator": "dev-main",
"rector\/rector-src": "dev-main",
"rector\/rector-src": "dev-main#b96e692",
"symfony\/console": "^6.0",
"symplify\/coding-standard": "^10.2",
"symplify\/easy-coding-standard": "^10.2",