mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-15 23:52:23 +00:00
Updated Rector to commit 00af33a5d4
00af33a5d4
[Rectify] [Php81] Enable Rectify on ArraySpreadInsteadOfArrayMergeRector on php 8.1 (#1383)
This commit is contained in:
parent
c726969380
commit
91d829557e
|
@ -36,6 +36,7 @@ final class FullyQualifiedNameClassNameImportSkipVoter implements \Rector\Coding
|
|||
public function shouldSkip($file, $fullyQualifiedObjectType, $node) : bool
|
||||
{
|
||||
// "new X" or "X::static()"
|
||||
/** @var array<string, string> $shortNamesToFullyQualifiedNames */
|
||||
$shortNamesToFullyQualifiedNames = $this->shortNameResolver->resolveFromFile($file);
|
||||
$loweredShortNameFullyQualified = $fullyQualifiedObjectType->getShortNameLowered();
|
||||
foreach ($shortNamesToFullyQualifiedNames as $shortName => $fullyQualifiedName) {
|
||||
|
|
|
@ -148,7 +148,9 @@ final class ShortNameResolver
|
|||
$shortNamesToFullyQualifiedNames[$originalName->toString()] = $fullyQualifiedName;
|
||||
});
|
||||
$docBlockShortNamesToFullyQualifiedNames = $this->resolveFromStmtsDocBlocks($stmts);
|
||||
return \array_merge($shortNamesToFullyQualifiedNames, $docBlockShortNamesToFullyQualifiedNames);
|
||||
/** @var array<string, string> $result */
|
||||
$result = \array_merge($shortNamesToFullyQualifiedNames, $docBlockShortNamesToFullyQualifiedNames);
|
||||
return $result;
|
||||
}
|
||||
/**
|
||||
* @param Stmt[] $stmts
|
||||
|
|
|
@ -91,7 +91,10 @@ CODE_SAMPLE
|
|||
return null;
|
||||
}
|
||||
$collectedVariableTypesByNames = $this->mockVariableCollector->collectMockVariableName($node);
|
||||
$this->mockVariableTypesByNames = \array_merge($this->mockVariableTypesByNames, $collectedVariableTypesByNames);
|
||||
$item0Unpacked = $this->mockVariableTypesByNames;
|
||||
/** @var array<string, class-string> $result */
|
||||
$result = \array_merge($item0Unpacked, $collectedVariableTypesByNames);
|
||||
$this->mockVariableTypesByNames = $result;
|
||||
$parentNode = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
|
||||
if ($parentNode instanceof \PhpParser\Node\Arg) {
|
||||
$prophesizeMethodCall = $this->createProphesizeMethodCall($node);
|
||||
|
|
|
@ -16,11 +16,11 @@ final class VersionResolver
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'fc10fce13dcf9767f54e4202b509020fed338645';
|
||||
public const PACKAGE_VERSION = '00af33a5d410158e2892b7a3894cc036c306f2b7';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2021-12-04 15:32:52';
|
||||
public const RELEASE_DATE = '2021-12-04 12:47:07';
|
||||
public static function resolvePackageVersion() : string
|
||||
{
|
||||
$process = new \RectorPrefix20211204\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
|
||||
|
|
|
@ -23,7 +23,10 @@ final class RenamedClassesDataCollector
|
|||
*/
|
||||
public function addOldToNewClasses(array $oldToNewClasses) : void
|
||||
{
|
||||
$this->oldToNewClasses = \array_merge($this->oldToNewClasses, $oldToNewClasses);
|
||||
$item0Unpacked = $this->oldToNewClasses;
|
||||
/** @var array<string, string> $oldToNewClasses */
|
||||
$oldToNewClasses = \array_merge($item0Unpacked, $oldToNewClasses);
|
||||
$this->oldToNewClasses = $oldToNewClasses;
|
||||
}
|
||||
/**
|
||||
* @return array<string, string>
|
||||
|
|
|
@ -110,7 +110,11 @@ CODE_SAMPLE
|
|||
*/
|
||||
private function getRenameClasses() : array
|
||||
{
|
||||
return \array_merge($this->renameClasses, $this->renamedClassesDataCollector->getOldToNewClasses());
|
||||
$item0Unpacked = $this->renameClasses;
|
||||
$item1Unpacked = $this->renamedClassesDataCollector->getOldToNewClasses();
|
||||
/** @var array<string, string> $renameClasses */
|
||||
$renameClasses = \array_merge($item0Unpacked, $item1Unpacked);
|
||||
return $renameClasses;
|
||||
}
|
||||
private function createOldClassRegex(string $oldClass) : string
|
||||
{
|
||||
|
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -4,4 +4,4 @@
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit2fa6c5692128d13e4ac3f62f4c022acb::getLoader();
|
||||
return ComposerAutoloaderInita47e068f5c37a34236b00f602ac6b608::getLoader();
|
||||
|
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit2fa6c5692128d13e4ac3f62f4c022acb
|
||||
class ComposerAutoloaderInita47e068f5c37a34236b00f602ac6b608
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,15 +22,15 @@ class ComposerAutoloaderInit2fa6c5692128d13e4ac3f62f4c022acb
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit2fa6c5692128d13e4ac3f62f4c022acb', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInita47e068f5c37a34236b00f602ac6b608', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit2fa6c5692128d13e4ac3f62f4c022acb', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInita47e068f5c37a34236b00f602ac6b608', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit2fa6c5692128d13e4ac3f62f4c022acb::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInita47e068f5c37a34236b00f602ac6b608::getInitializer($loader));
|
||||
} else {
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
|
@ -42,19 +42,19 @@ class ComposerAutoloaderInit2fa6c5692128d13e4ac3f62f4c022acb
|
|||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit2fa6c5692128d13e4ac3f62f4c022acb::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInita47e068f5c37a34236b00f602ac6b608::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire2fa6c5692128d13e4ac3f62f4c022acb($fileIdentifier, $file);
|
||||
composerRequirea47e068f5c37a34236b00f602ac6b608($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequire2fa6c5692128d13e4ac3f62f4c022acb($fileIdentifier, $file)
|
||||
function composerRequirea47e068f5c37a34236b00f602ac6b608($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit2fa6c5692128d13e4ac3f62f4c022acb
|
||||
class ComposerStaticInita47e068f5c37a34236b00f602ac6b608
|
||||
{
|
||||
public static $files = array (
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||
|
@ -3796,9 +3796,9 @@ class ComposerStaticInit2fa6c5692128d13e4ac3f62f4c022acb
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit2fa6c5692128d13e4ac3f62f4c022acb::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit2fa6c5692128d13e4ac3f62f4c022acb::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit2fa6c5692128d13e4ac3f62f4c022acb::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInita47e068f5c37a34236b00f602ac6b608::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInita47e068f5c37a34236b00f602ac6b608::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInita47e068f5c37a34236b00f602ac6b608::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
10
vendor/scoper-autoload.php
vendored
10
vendor/scoper-autoload.php
vendored
|
@ -12,8 +12,8 @@ if (!class_exists('GenerateChangelogCommand', false) && !interface_exists('Gener
|
|||
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
|
||||
spl_autoload_call('RectorPrefix20211204\AutoloadIncluder');
|
||||
}
|
||||
if (!class_exists('ComposerAutoloaderInit2fa6c5692128d13e4ac3f62f4c022acb', false) && !interface_exists('ComposerAutoloaderInit2fa6c5692128d13e4ac3f62f4c022acb', false) && !trait_exists('ComposerAutoloaderInit2fa6c5692128d13e4ac3f62f4c022acb', false)) {
|
||||
spl_autoload_call('RectorPrefix20211204\ComposerAutoloaderInit2fa6c5692128d13e4ac3f62f4c022acb');
|
||||
if (!class_exists('ComposerAutoloaderInita47e068f5c37a34236b00f602ac6b608', false) && !interface_exists('ComposerAutoloaderInita47e068f5c37a34236b00f602ac6b608', false) && !trait_exists('ComposerAutoloaderInita47e068f5c37a34236b00f602ac6b608', false)) {
|
||||
spl_autoload_call('RectorPrefix20211204\ComposerAutoloaderInita47e068f5c37a34236b00f602ac6b608');
|
||||
}
|
||||
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('RectorPrefix20211204\Helmich\TypoScriptParser\Parser\AST\Statement');
|
||||
|
@ -81,9 +81,9 @@ if (!function_exists('print_node')) {
|
|||
return \RectorPrefix20211204\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('composerRequire2fa6c5692128d13e4ac3f62f4c022acb')) {
|
||||
function composerRequire2fa6c5692128d13e4ac3f62f4c022acb() {
|
||||
return \RectorPrefix20211204\composerRequire2fa6c5692128d13e4ac3f62f4c022acb(...func_get_args());
|
||||
if (!function_exists('composerRequirea47e068f5c37a34236b00f602ac6b608')) {
|
||||
function composerRequirea47e068f5c37a34236b00f602ac6b608() {
|
||||
return \RectorPrefix20211204\composerRequirea47e068f5c37a34236b00f602ac6b608(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('scanPath')) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user