From 5b1b83ed617c1a269a937f2493f45a818841a25a Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 14 Aug 2023 14:31:01 +0000 Subject: [PATCH] Updated Rector to commit 685fe90cb8752c2a288ee982d03d15d8df6b59f2 https://github.com/rectorphp/rector-src/commit/685fe90cb8752c2a288ee982d03d15d8df6b59f2 Make SimplifyUselessVariableRector run without scope (#4791) --- .../SimplifyUselessVariableRector.php | 16 ++++------ src/Application/VersionResolver.php | 4 +-- .../Parameter/SimpleParameterProvider.php | 4 +-- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +++---- vendor/composer/autoload_static.php | 8 ++--- vendor/composer/installed.json | 8 ++--- vendor/composer/installed.php | 2 +- vendor/nette/utils/src/Utils/Arrays.php | 4 +-- .../src/GeneratedConfig.php | 2 +- .../FuncCall/DowngradeArrayIsListRector.php | 29 ++++++------------- .../Definition/Dumper/YamlReferenceDumper.php | 4 +-- .../config/Definition/PrototypedArrayNode.php | 8 ++--- .../Compiler/ResolveNamedArgumentsPass.php | 4 +-- .../dependency-injection/ContainerBuilder.php | 4 +-- .../dependency-injection/Dumper/XmlDumper.php | 4 +-- 16 files changed, 48 insertions(+), 65 deletions(-) diff --git a/rules/CodeQuality/Rector/FunctionLike/SimplifyUselessVariableRector.php b/rules/CodeQuality/Rector/FunctionLike/SimplifyUselessVariableRector.php index 5b71f57773bd..e64530a01d99 100644 --- a/rules/CodeQuality/Rector/FunctionLike/SimplifyUselessVariableRector.php +++ b/rules/CodeQuality/Rector/FunctionLike/SimplifyUselessVariableRector.php @@ -11,21 +11,19 @@ use PhpParser\Node\Stmt; use PhpParser\Node\Stmt\Expression; use PhpParser\Node\Stmt\Return_; -use PHPStan\Analyser\Scope; -use PHPStan\Reflection\FunctionReflection; use PHPStan\Type\MixedType; use Rector\Core\Contract\PhpParser\Node\StmtsAwareInterface; use Rector\Core\NodeAnalyzer\CallAnalyzer; use Rector\Core\NodeAnalyzer\VariableAnalyzer; use Rector\Core\PhpParser\Node\AssignAndBinaryMap; -use Rector\Core\Rector\AbstractScopeAwareRector; +use Rector\Core\Rector\AbstractRector; use Rector\NodeTypeResolver\Node\AttributeKey; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Tests\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector\SimplifyUselessVariableRectorTest */ -final class SimplifyUselessVariableRector extends AbstractScopeAwareRector +final class SimplifyUselessVariableRector extends AbstractRector { /** * @readonly @@ -73,7 +71,7 @@ public function getNodeTypes() : array /** * @param StmtsAwareInterface $node */ - public function refactorWithScope(Node $node, Scope $scope) : ?Node + public function refactor(Node $node) : ?Node { $stmts = $node->stmts; if ($stmts === null) { @@ -88,7 +86,7 @@ public function refactorWithScope(Node $node, Scope $scope) : ?Node continue; } $previousStmt = $stmts[$key - 1]; - if ($this->shouldSkipStmt($stmt, $previousStmt, $scope)) { + if ($this->shouldSkipStmt($stmt, $previousStmt)) { return null; } if ($this->hasSomeComment($previousStmt)) { @@ -120,15 +118,11 @@ private function processSimplifyUselessVariable(StmtsAwareInterface $stmtsAware, unset($stmtsAware->stmts[$key - 1]); return $stmtsAware; } - private function shouldSkipStmt(Return_ $return, Stmt $previousStmt, Scope $scope) : bool + private function shouldSkipStmt(Return_ $return, Stmt $previousStmt) : bool { if (!$return->expr instanceof Variable) { return \true; } - $functionReflection = $scope->getFunction(); - if ($functionReflection instanceof FunctionReflection && $functionReflection->returnsByReference()->yes()) { - return \true; - } if ($return->getAttribute(AttributeKey::IS_BYREF_RETURN) === \true) { return \true; } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index eff2767e5273..d6bd48ae0eda 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '2fe68ad7649faf0ebec883dcdeb91ee6118297ce'; + public const PACKAGE_VERSION = '685fe90cb8752c2a288ee982d03d15d8df6b59f2'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-08-14 13:42:14'; + public const RELEASE_DATE = '2023-08-14 15:27:05'; /** * @var int */ diff --git a/src/Configuration/Parameter/SimpleParameterProvider.php b/src/Configuration/Parameter/SimpleParameterProvider.php index 4611c9066ac5..7adfe317a1f5 100644 --- a/src/Configuration/Parameter/SimpleParameterProvider.php +++ b/src/Configuration/Parameter/SimpleParameterProvider.php @@ -44,7 +44,7 @@ public static function provideArrayParameter(string $name) : array { $parameter = self::$parameters[$name] ?? []; Assert::isArray($parameter); - $arrayIsList = function (array $array) : bool { + $arrayIsListFunction = function (array $array) : bool { if (\function_exists('array_is_list')) { return \array_is_list($array); } @@ -60,7 +60,7 @@ public static function provideArrayParameter(string $name) : array } return \true; }; - if ($arrayIsList($parameter)) { + if ($arrayIsListFunction($parameter)) { // remove duplicates $uniqueParameters = \array_unique($parameter); return \array_values($uniqueParameters); diff --git a/vendor/autoload.php b/vendor/autoload.php index 40cf3d55f5e5..a7af109bf49a 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitef003b203866411843a8ebe2ebc6e04a::getLoader(); +return ComposerAutoloaderInit9c580ee581ac8dff49b345ac114fb239::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 0169505e7a57..73eef13bc66b 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitef003b203866411843a8ebe2ebc6e04a +class ComposerAutoloaderInit9c580ee581ac8dff49b345ac114fb239 { private static $loader; @@ -22,17 +22,17 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitef003b203866411843a8ebe2ebc6e04a', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit9c580ee581ac8dff49b345ac114fb239', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitef003b203866411843a8ebe2ebc6e04a', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit9c580ee581ac8dff49b345ac114fb239', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitef003b203866411843a8ebe2ebc6e04a::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit9c580ee581ac8dff49b345ac114fb239::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInitef003b203866411843a8ebe2ebc6e04a::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit9c580ee581ac8dff49b345ac114fb239::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 66d36d0a6c2b..af11a46b17c9 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitef003b203866411843a8ebe2ebc6e04a +class ComposerStaticInit9c580ee581ac8dff49b345ac114fb239 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -2959,9 +2959,9 @@ class ComposerStaticInitef003b203866411843a8ebe2ebc6e04a public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitef003b203866411843a8ebe2ebc6e04a::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitef003b203866411843a8ebe2ebc6e04a::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitef003b203866411843a8ebe2ebc6e04a::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit9c580ee581ac8dff49b345ac114fb239::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit9c580ee581ac8dff49b345ac114fb239::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit9c580ee581ac8dff49b345ac114fb239::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 59ded30166df..73a8f21ae52c 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1917,12 +1917,12 @@ "source": { "type": "git", "url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git", - "reference": "47f72d5d2b747a73cf30bee2c798dc9cf21e3411" + "reference": "51f273773c748e34c3418cdc569992b5de00128f" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/47f72d5d2b747a73cf30bee2c798dc9cf21e3411", - "reference": "47f72d5d2b747a73cf30bee2c798dc9cf21e3411", + "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/51f273773c748e34c3418cdc569992b5de00128f", + "reference": "51f273773c748e34c3418cdc569992b5de00128f", "shasum": "" }, "require": { @@ -1948,7 +1948,7 @@ "tomasvotruba\/type-coverage": "^0.2", "tomasvotruba\/unused-public": "^0.1" }, - "time": "2023-08-13T11:39:42+00:00", + "time": "2023-08-14T14:00:50+00:00", "default-branch": true, "type": "rector-extension", "extra": { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index c8817209a619..d64ce6ba88b0 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -2,4 +2,4 @@ namespace RectorPrefix202308; -return array('root' => array('name' => 'rector/rector-src', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => NULL, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \false), 'versions' => array('clue/ndjson-react' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '392dc165fce93b5bb5c637b67e59619223c931b0', 'type' => 'library', 'install_path' => __DIR__ . '/../clue/ndjson-react', 'aliases' => array(), 'dev_requirement' => \false), 'composer/pcre' => array('pretty_version' => '3.1.0', 'version' => '3.1.0.0', 'reference' => '4bff79ddd77851fe3cdd11616ed3f92841ba5bd2', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), 'dev_requirement' => \false), 'composer/semver' => array('pretty_version' => '3.3.2', 'version' => '3.3.2.0', 'reference' => '3953f23262f2bff1919fc82183ad9acb13ff62c9', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), 'dev_requirement' => \false), 'composer/xdebug-handler' => array('pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'reference' => 'ced299686f41dce890debac69273b47ffe98a40c', 'type' => 'library', 'install_path' => __DIR__ . '/./xdebug-handler', 'aliases' => array(), 'dev_requirement' => \false), 'doctrine/inflector' => array('pretty_version' => '2.0.8', 'version' => '2.0.8.0', 'reference' => 'f9301a5b2fb1216b2b08f02ba04dc45423db6bff', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), 'dev_requirement' => \false), 'evenement/evenement' => array('pretty_version' => 'v3.0.2', 'version' => '3.0.2.0', 'reference' => '0a16b0d71ab13284339abb99d9d2bd813640efbc', 'type' => 'library', 'install_path' => __DIR__ . '/../evenement/evenement', 'aliases' => array(), 'dev_requirement' => \false), 'fidry/cpu-core-counter' => array('pretty_version' => '0.5.1', 'version' => '0.5.1.0', 'reference' => 'b58e5a3933e541dc286cc91fc4f3898bbc6f1623', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/container' => array('pretty_version' => 'v10.18.0', 'version' => '10.18.0.0', 'reference' => 'ddc26273085fad3c471b2602ad820e0097ff7939', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/contracts' => array('pretty_version' => 'v10.18.0', 'version' => '10.18.0.0', 'reference' => 'eb1a7e72e159136a832f2c0467de5570bdc208ae', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v3.2.10', 'version' => '3.2.10.0', 'reference' => 'a4175c62652f2300c8017fb7e640f9ccb11648d2', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v4.17.1', 'version' => '4.17.1.0', 'reference' => 'a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), 'dev_requirement' => \false), 'ondram/ci-detector' => array('pretty_version' => '4.1.0', 'version' => '4.1.0.0', 'reference' => '8a4b664e916df82ff26a44709942dfd593fa6f30', 'type' => 'library', 'install_path' => __DIR__ . '/../ondram/ci-detector', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpdoc-parser' => array('pretty_version' => '1.23.1', 'version' => '1.23.1.0', 'reference' => '846ae76eef31c6d7790fac9bc399ecee45160b26', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('pretty_version' => '1.10.29', 'version' => '1.10.29.0', 'reference' => 'ee5d8f2d3977fb09e55603eee6fb53bdd76ee9c1', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpstan', 'aliases' => array(), 'dev_requirement' => \false), 'psr/cache' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/cache', 'aliases' => array(), 'dev_requirement' => \false), 'psr/container' => array('pretty_version' => '2.0.2', 'version' => '2.0.2.0', 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), 'dev_requirement' => \false), 'psr/container-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0')), 'psr/event-dispatcher' => array('pretty_version' => '1.0.0', 'version' => '1.0.0.0', 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/event-dispatcher', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0|2.0|3.0')), 'psr/simple-cache' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/simple-cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/cache' => array('pretty_version' => 'v1.2.0', 'version' => '1.2.0.0', 'reference' => 'd47c472b64aa5608225f47965a484b75c7817d5b', 'type' => 'library', 'install_path' => __DIR__ . '/../react/cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/child-process' => array('pretty_version' => 'v0.6.5', 'version' => '0.6.5.0', 'reference' => 'e71eb1aa55f057c7a4a0d08d06b0b0a484bead43', 'type' => 'library', 'install_path' => __DIR__ . '/../react/child-process', 'aliases' => array(), 'dev_requirement' => \false), 'react/dns' => array('pretty_version' => 'v1.11.0', 'version' => '1.11.0.0', 'reference' => '3be0fc8f1eb37d6875cd6f0c6c7d0be81435de9f', 'type' => 'library', 'install_path' => __DIR__ . '/../react/dns', 'aliases' => array(), 'dev_requirement' => \false), 'react/event-loop' => array('pretty_version' => 'v1.4.0', 'version' => '1.4.0.0', 'reference' => '6e7e587714fff7a83dcc7025aee42ab3b265ae05', 'type' => 'library', 'install_path' => __DIR__ . '/../react/event-loop', 'aliases' => array(), 'dev_requirement' => \false), 'react/promise' => array('pretty_version' => 'v2.10.0', 'version' => '2.10.0.0', 'reference' => 'f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.13.0', 'version' => '1.13.0.0', 'reference' => 'cff482bbad5848ecbe8b57da57e4e213b03619aa', 'type' => 'library', 'install_path' => __DIR__ . '/../react/socket', 'aliases' => array(), 'dev_requirement' => \false), 'react/stream' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '6fbc9672905c7d5a885f2da2fc696f65840f4a66', 'type' => 'library', 'install_path' => __DIR__ . '/../react/stream', 'aliases' => array(), 'dev_requirement' => \false), 'rector/extension-installer' => array('pretty_version' => '0.11.2', 'version' => '0.11.2.0', 'reference' => '05544e9b195863b8571ae2a3b903cbec7fa062e0', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../rector/extension-installer', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector' => array('dev_requirement' => \false, 'replaced' => array(0 => 'dev-main')), 'rector/rector-doctrine' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '0b976ae78689b9ded3c79a00a506b833f3e75146', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-doctrine', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-downgrade-php' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '47f72d5d2b747a73cf30bee2c798dc9cf21e3411', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-downgrade-php', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-phpunit' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'f2571b8cf102329c8373619c47bac582e7213c6a', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-phpunit', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-src' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => NULL, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector-symfony' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '23bb5222530f6e48a5e4e3c095b0a76cb6b38e7b', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-symfony', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'sebastian/diff' => array('pretty_version' => '5.0.3', 'version' => '5.0.3.0', 'reference' => '912dc2fbe3e3c1e7873313cc801b100b6c68c87b', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/cache-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.3.0')), 'symfony/config' => array('pretty_version' => 'v6.3.2', 'version' => '6.3.2.0', 'reference' => 'b47ca238b03e7b0d7880ffd1cf06e8d637ca1467', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/config', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.3.2', 'version' => '6.3.2.0', 'reference' => 'aa5d64ad3f63f2e48964fc81ee45cb318a723898', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/contracts' => array('pretty_version' => 'v3.3.0', 'version' => '3.3.0.0', 'reference' => '9e4b5e4e44e7620475dbceecf7c72c3883f3ea35', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/dependency-injection' => array('pretty_version' => 'v6.1.12', 'version' => '6.1.12.0', 'reference' => '360c9d0948e1fe675336346d5862e8e55b378d90', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/dependency-injection', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.3.0')), 'symfony/error-handler' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/event-dispatcher-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.3.0')), 'symfony/filesystem' => array('pretty_version' => 'v6.3.1', 'version' => '6.3.1.0', 'reference' => 'edd36776956f2a6fcf577edb5b05eb0e3bdc52ae', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.3.3', 'version' => '6.3.3.0', 'reference' => '9915db259f67d21eefee768c1abcf1cc61b1fc9e', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/http-client-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.3.0')), 'symfony/polyfill-ctype' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-grapheme' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-normalizer' => array('pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', 'reference' => '19bd1e4fcd5b91116f14d8533c57831ed00571b6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-mbstring' => array('pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/process' => array('pretty_version' => 'v6.3.2', 'version' => '6.3.2.0', 'reference' => 'c5ce962db0d9b6e80247ca5eb9af6472bd4d7b5d', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.3.0')), 'symfony/service-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0|3.0')), 'symfony/string' => array('pretty_version' => 'v6.3.2', 'version' => '6.3.2.0', 'reference' => '53d1a83225002635bca3482fcbf963001313fb68', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/string', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/translation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.3.0')), 'symfony/var-dumper' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symplify/easy-parallel' => array('pretty_version' => '11.1.27', 'version' => '11.1.27.0', 'reference' => '28911142f6a0f4127271f745e2403bb84fcd2b87', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/easy-parallel', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/rule-doc-generator-contracts' => array('pretty_version' => '11.1.26', 'version' => '11.1.26.0', 'reference' => '3e66b3fec678b74a076395ec629d535fb95293b5', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/rule-doc-generator-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'webmozart/assert' => array('pretty_version' => '1.11.0', 'version' => '1.11.0.0', 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', 'type' => 'library', 'install_path' => __DIR__ . '/../webmozart/assert', 'aliases' => array(), 'dev_requirement' => \false))); +return array('root' => array('name' => 'rector/rector-src', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => NULL, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \false), 'versions' => array('clue/ndjson-react' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '392dc165fce93b5bb5c637b67e59619223c931b0', 'type' => 'library', 'install_path' => __DIR__ . '/../clue/ndjson-react', 'aliases' => array(), 'dev_requirement' => \false), 'composer/pcre' => array('pretty_version' => '3.1.0', 'version' => '3.1.0.0', 'reference' => '4bff79ddd77851fe3cdd11616ed3f92841ba5bd2', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), 'dev_requirement' => \false), 'composer/semver' => array('pretty_version' => '3.3.2', 'version' => '3.3.2.0', 'reference' => '3953f23262f2bff1919fc82183ad9acb13ff62c9', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), 'dev_requirement' => \false), 'composer/xdebug-handler' => array('pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'reference' => 'ced299686f41dce890debac69273b47ffe98a40c', 'type' => 'library', 'install_path' => __DIR__ . '/./xdebug-handler', 'aliases' => array(), 'dev_requirement' => \false), 'doctrine/inflector' => array('pretty_version' => '2.0.8', 'version' => '2.0.8.0', 'reference' => 'f9301a5b2fb1216b2b08f02ba04dc45423db6bff', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), 'dev_requirement' => \false), 'evenement/evenement' => array('pretty_version' => 'v3.0.2', 'version' => '3.0.2.0', 'reference' => '0a16b0d71ab13284339abb99d9d2bd813640efbc', 'type' => 'library', 'install_path' => __DIR__ . '/../evenement/evenement', 'aliases' => array(), 'dev_requirement' => \false), 'fidry/cpu-core-counter' => array('pretty_version' => '0.5.1', 'version' => '0.5.1.0', 'reference' => 'b58e5a3933e541dc286cc91fc4f3898bbc6f1623', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/container' => array('pretty_version' => 'v10.18.0', 'version' => '10.18.0.0', 'reference' => 'ddc26273085fad3c471b2602ad820e0097ff7939', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/contracts' => array('pretty_version' => 'v10.18.0', 'version' => '10.18.0.0', 'reference' => 'eb1a7e72e159136a832f2c0467de5570bdc208ae', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v3.2.10', 'version' => '3.2.10.0', 'reference' => 'a4175c62652f2300c8017fb7e640f9ccb11648d2', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v4.17.1', 'version' => '4.17.1.0', 'reference' => 'a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), 'dev_requirement' => \false), 'ondram/ci-detector' => array('pretty_version' => '4.1.0', 'version' => '4.1.0.0', 'reference' => '8a4b664e916df82ff26a44709942dfd593fa6f30', 'type' => 'library', 'install_path' => __DIR__ . '/../ondram/ci-detector', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpdoc-parser' => array('pretty_version' => '1.23.1', 'version' => '1.23.1.0', 'reference' => '846ae76eef31c6d7790fac9bc399ecee45160b26', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('pretty_version' => '1.10.29', 'version' => '1.10.29.0', 'reference' => 'ee5d8f2d3977fb09e55603eee6fb53bdd76ee9c1', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpstan', 'aliases' => array(), 'dev_requirement' => \false), 'psr/cache' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/cache', 'aliases' => array(), 'dev_requirement' => \false), 'psr/container' => array('pretty_version' => '2.0.2', 'version' => '2.0.2.0', 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), 'dev_requirement' => \false), 'psr/container-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0')), 'psr/event-dispatcher' => array('pretty_version' => '1.0.0', 'version' => '1.0.0.0', 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/event-dispatcher', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0|2.0|3.0')), 'psr/simple-cache' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/simple-cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/cache' => array('pretty_version' => 'v1.2.0', 'version' => '1.2.0.0', 'reference' => 'd47c472b64aa5608225f47965a484b75c7817d5b', 'type' => 'library', 'install_path' => __DIR__ . '/../react/cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/child-process' => array('pretty_version' => 'v0.6.5', 'version' => '0.6.5.0', 'reference' => 'e71eb1aa55f057c7a4a0d08d06b0b0a484bead43', 'type' => 'library', 'install_path' => __DIR__ . '/../react/child-process', 'aliases' => array(), 'dev_requirement' => \false), 'react/dns' => array('pretty_version' => 'v1.11.0', 'version' => '1.11.0.0', 'reference' => '3be0fc8f1eb37d6875cd6f0c6c7d0be81435de9f', 'type' => 'library', 'install_path' => __DIR__ . '/../react/dns', 'aliases' => array(), 'dev_requirement' => \false), 'react/event-loop' => array('pretty_version' => 'v1.4.0', 'version' => '1.4.0.0', 'reference' => '6e7e587714fff7a83dcc7025aee42ab3b265ae05', 'type' => 'library', 'install_path' => __DIR__ . '/../react/event-loop', 'aliases' => array(), 'dev_requirement' => \false), 'react/promise' => array('pretty_version' => 'v2.10.0', 'version' => '2.10.0.0', 'reference' => 'f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.13.0', 'version' => '1.13.0.0', 'reference' => 'cff482bbad5848ecbe8b57da57e4e213b03619aa', 'type' => 'library', 'install_path' => __DIR__ . '/../react/socket', 'aliases' => array(), 'dev_requirement' => \false), 'react/stream' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '6fbc9672905c7d5a885f2da2fc696f65840f4a66', 'type' => 'library', 'install_path' => __DIR__ . '/../react/stream', 'aliases' => array(), 'dev_requirement' => \false), 'rector/extension-installer' => array('pretty_version' => '0.11.2', 'version' => '0.11.2.0', 'reference' => '05544e9b195863b8571ae2a3b903cbec7fa062e0', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../rector/extension-installer', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector' => array('dev_requirement' => \false, 'replaced' => array(0 => 'dev-main')), 'rector/rector-doctrine' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '0b976ae78689b9ded3c79a00a506b833f3e75146', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-doctrine', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-downgrade-php' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '51f273773c748e34c3418cdc569992b5de00128f', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-downgrade-php', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-phpunit' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'f2571b8cf102329c8373619c47bac582e7213c6a', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-phpunit', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-src' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => NULL, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector-symfony' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '23bb5222530f6e48a5e4e3c095b0a76cb6b38e7b', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-symfony', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'sebastian/diff' => array('pretty_version' => '5.0.3', 'version' => '5.0.3.0', 'reference' => '912dc2fbe3e3c1e7873313cc801b100b6c68c87b', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/cache-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.3.0')), 'symfony/config' => array('pretty_version' => 'v6.3.2', 'version' => '6.3.2.0', 'reference' => 'b47ca238b03e7b0d7880ffd1cf06e8d637ca1467', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/config', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.3.2', 'version' => '6.3.2.0', 'reference' => 'aa5d64ad3f63f2e48964fc81ee45cb318a723898', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/contracts' => array('pretty_version' => 'v3.3.0', 'version' => '3.3.0.0', 'reference' => '9e4b5e4e44e7620475dbceecf7c72c3883f3ea35', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/dependency-injection' => array('pretty_version' => 'v6.1.12', 'version' => '6.1.12.0', 'reference' => '360c9d0948e1fe675336346d5862e8e55b378d90', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/dependency-injection', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.3.0')), 'symfony/error-handler' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/event-dispatcher-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.3.0')), 'symfony/filesystem' => array('pretty_version' => 'v6.3.1', 'version' => '6.3.1.0', 'reference' => 'edd36776956f2a6fcf577edb5b05eb0e3bdc52ae', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.3.3', 'version' => '6.3.3.0', 'reference' => '9915db259f67d21eefee768c1abcf1cc61b1fc9e', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/http-client-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.3.0')), 'symfony/polyfill-ctype' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-grapheme' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-normalizer' => array('pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', 'reference' => '19bd1e4fcd5b91116f14d8533c57831ed00571b6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-mbstring' => array('pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/process' => array('pretty_version' => 'v6.3.2', 'version' => '6.3.2.0', 'reference' => 'c5ce962db0d9b6e80247ca5eb9af6472bd4d7b5d', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.3.0')), 'symfony/service-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0|3.0')), 'symfony/string' => array('pretty_version' => 'v6.3.2', 'version' => '6.3.2.0', 'reference' => '53d1a83225002635bca3482fcbf963001313fb68', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/string', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/translation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.3.0')), 'symfony/var-dumper' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symplify/easy-parallel' => array('pretty_version' => '11.1.27', 'version' => '11.1.27.0', 'reference' => '28911142f6a0f4127271f745e2403bb84fcd2b87', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/easy-parallel', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/rule-doc-generator-contracts' => array('pretty_version' => '11.1.26', 'version' => '11.1.26.0', 'reference' => '3e66b3fec678b74a076395ec629d535fb95293b5', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/rule-doc-generator-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'webmozart/assert' => array('pretty_version' => '1.11.0', 'version' => '1.11.0.0', 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', 'type' => 'library', 'install_path' => __DIR__ . '/../webmozart/assert', 'aliases' => array(), 'dev_requirement' => \false))); diff --git a/vendor/nette/utils/src/Utils/Arrays.php b/vendor/nette/utils/src/Utils/Arrays.php index b7b027cec38a..97703f7d2941 100644 --- a/vendor/nette/utils/src/Utils/Arrays.php +++ b/vendor/nette/utils/src/Utils/Arrays.php @@ -198,7 +198,7 @@ public static function flatten(array $array, bool $preserveKeys = \false) : arra */ public static function isList($value) : bool { - $arrayIsList = function (array $array) : bool { + $arrayIsListFunction = function (array $array) : bool { if (\function_exists('array_is_list')) { return \array_is_list($array); } @@ -214,7 +214,7 @@ public static function isList($value) : bool } return \true; }; - return is_array($value) && (\PHP_VERSION_ID < 80100 ? !$value || \array_keys($value) === \range(0, count($value) - 1) : $arrayIsList($value)); + return is_array($value) && (\PHP_VERSION_ID < 80100 ? !$value || \array_keys($value) === \range(0, count($value) - 1) : $arrayIsListFunction($value)); } /** * Reformats table to associative tree. Path looks like 'field|field[]field->field=field'. diff --git a/vendor/rector/extension-installer/src/GeneratedConfig.php b/vendor/rector/extension-installer/src/GeneratedConfig.php index d489c1a58cbf..87e0c60f5803 100644 --- a/vendor/rector/extension-installer/src/GeneratedConfig.php +++ b/vendor/rector/extension-installer/src/GeneratedConfig.php @@ -9,7 +9,7 @@ */ final class GeneratedConfig { - public const EXTENSIONS = array('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 0b976ae'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 47f72d5'), '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 f2571b8'), '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 23bb522')); + public const EXTENSIONS = array('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 0b976ae'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 51f2737'), '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 f2571b8'), '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 23bb522')); private function __construct() { } diff --git a/vendor/rector/rector-downgrade-php/rules/DowngradePhp81/Rector/FuncCall/DowngradeArrayIsListRector.php b/vendor/rector/rector-downgrade-php/rules/DowngradePhp81/Rector/FuncCall/DowngradeArrayIsListRector.php index debcef23e5b2..e57cf2255d49 100644 --- a/vendor/rector/rector-downgrade-php/rules/DowngradePhp81/Rector/FuncCall/DowngradeArrayIsListRector.php +++ b/vendor/rector/rector-downgrade-php/rules/DowngradePhp81/Rector/FuncCall/DowngradeArrayIsListRector.php @@ -17,8 +17,7 @@ use Rector\Core\Contract\PhpParser\Node\StmtsAwareInterface; use Rector\Core\Exception\ShouldNotHappenException; use Rector\Core\PhpParser\Parser\InlineCodeParser; -use Rector\Core\Rector\AbstractScopeAwareRector; -use Rector\Naming\Naming\VariableNaming; +use Rector\Core\Rector\AbstractRector; use Rector\NodeAnalyzer\ExprInTopStmtMatcher; use Rector\NodeTypeResolver\Node\AttributeKey; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; @@ -28,18 +27,13 @@ * * @see \Rector\Tests\DowngradePhp81\Rector\FuncCall\DowngradeArrayIsListRector\DowngradeArrayIsListRectorTest */ -final class DowngradeArrayIsListRector extends AbstractScopeAwareRector +final class DowngradeArrayIsListRector extends AbstractRector { /** * @readonly * @var \Rector\Core\PhpParser\Parser\InlineCodeParser */ private $inlineCodeParser; - /** - * @readonly - * @var \Rector\Naming\Naming\VariableNaming - */ - private $variableNaming; /** * @readonly * @var \Rector\NodeAnalyzer\ExprInTopStmtMatcher @@ -49,10 +43,9 @@ final class DowngradeArrayIsListRector extends AbstractScopeAwareRector * @var \PhpParser\Node\Expr\Closure|null */ private $cachedClosure; - public function __construct(InlineCodeParser $inlineCodeParser, VariableNaming $variableNaming, ExprInTopStmtMatcher $exprInTopStmtMatcher) + public function __construct(InlineCodeParser $inlineCodeParser, ExprInTopStmtMatcher $exprInTopStmtMatcher) { $this->inlineCodeParser = $inlineCodeParser; - $this->variableNaming = $variableNaming; $this->exprInTopStmtMatcher = $exprInTopStmtMatcher; } public function getRuleDefinition() : RuleDefinition @@ -95,20 +88,19 @@ public function getNodeTypes() : array * @param StmtsAwareInterface|Switch_|Return_|Expression|Echo_ $node * @return Node[]|null */ - public function refactorWithScope(Node $node, Scope $scope) : ?array + public function refactor(Node $node) : ?array { $expr = $this->exprInTopStmtMatcher->match($node, function (Node $subNode) : bool { if (!$subNode instanceof FuncCall) { return \false; } // need pull Scope from target traversed sub Node - $scope = $subNode->getAttribute(AttributeKey::SCOPE); - return !$this->shouldSkip($subNode, $scope); + return !$this->shouldSkip($subNode); }); if (!$expr instanceof FuncCall) { return null; } - $variable = new Variable($this->variableNaming->createCountedValueName('arrayIsList', $scope)); + $variable = new Variable('arrayIsListFunction'); $function = $this->createClosure(); $expression = new Expression(new Assign($variable, $function)); $expr->name = $variable; @@ -129,7 +121,7 @@ private function createClosure() : Closure $this->cachedClosure = $expr; return $expr; } - private function shouldSkip(CallLike $callLike, ?Scope $scope) : bool + private function shouldSkip(CallLike $callLike) : bool { if (!$callLike instanceof FuncCall) { return \false; @@ -137,11 +129,8 @@ private function shouldSkip(CallLike $callLike, ?Scope $scope) : bool if (!$this->nodeNameResolver->isName($callLike, 'array_is_list')) { return \true; } - if (!$scope instanceof Scope) { - $args = $callLike->getArgs(); - return \count($args) !== 1; - } - if ($scope->isInFunctionExists('array_is_list')) { + $scope = $callLike->getAttribute(AttributeKey::SCOPE); + if ($scope instanceof Scope && $scope->isInFunctionExists('array_is_list')) { return \true; } $args = $callLike->getArgs(); diff --git a/vendor/symfony/config/Definition/Dumper/YamlReferenceDumper.php b/vendor/symfony/config/Definition/Dumper/YamlReferenceDumper.php index 83d46c2c4573..b7564562f916 100644 --- a/vendor/symfony/config/Definition/Dumper/YamlReferenceDumper.php +++ b/vendor/symfony/config/Definition/Dumper/YamlReferenceDumper.php @@ -168,7 +168,7 @@ private function writeLine(string $text, int $indent = 0) : void } private function writeArray(array $array, int $depth) : void { - $arrayIsList = function (array $array) : bool { + $arrayIsListFunction = function (array $array) : bool { if (\function_exists('array_is_list')) { return \array_is_list($array); } @@ -184,7 +184,7 @@ private function writeArray(array $array, int $depth) : void } return \true; }; - $isIndexed = $arrayIsList($array); + $isIndexed = $arrayIsListFunction($array); foreach ($array as $key => $value) { if (\is_array($value)) { $val = ''; diff --git a/vendor/symfony/config/Definition/PrototypedArrayNode.php b/vendor/symfony/config/Definition/PrototypedArrayNode.php index 30a5f06a2755..5cf164e80957 100644 --- a/vendor/symfony/config/Definition/PrototypedArrayNode.php +++ b/vendor/symfony/config/Definition/PrototypedArrayNode.php @@ -186,7 +186,7 @@ protected function normalizeValue($value) return $value; } $value = $this->remapXml($value); - $arrayIsList = function (array $array) : bool { + $arrayIsListFunction = function (array $array) : bool { if (\function_exists('array_is_list')) { return \array_is_list($array); } @@ -202,7 +202,7 @@ protected function normalizeValue($value) } return \true; }; - $isList = $arrayIsList($value); + $isList = $arrayIsListFunction($value); $normalized = []; foreach ($value as $k => $v) { if (null !== $this->keyAttribute && \is_array($v)) { @@ -264,7 +264,7 @@ protected function mergeValues($leftSide, $rightSide) if (\false === $leftSide || !$this->performDeepMerging) { return $rightSide; } - $arrayIsList = function (array $array) : bool { + $arrayIsListFunction = function (array $array) : bool { if (\function_exists('array_is_list')) { return \array_is_list($array); } @@ -280,7 +280,7 @@ protected function mergeValues($leftSide, $rightSide) } return \true; }; - $isList = $arrayIsList($rightSide); + $isList = $arrayIsListFunction($rightSide); foreach ($rightSide as $k => $v) { // prototype, and key is irrelevant there are no named keys, append the element if (null === $this->keyAttribute && $isList) { diff --git a/vendor/symfony/dependency-injection/Compiler/ResolveNamedArgumentsPass.php b/vendor/symfony/dependency-injection/Compiler/ResolveNamedArgumentsPass.php index 48b288139763..7da403d78f6e 100644 --- a/vendor/symfony/dependency-injection/Compiler/ResolveNamedArgumentsPass.php +++ b/vendor/symfony/dependency-injection/Compiler/ResolveNamedArgumentsPass.php @@ -94,7 +94,7 @@ protected function processValue($value, bool $isRoot = \false) } if ($resolvedArguments !== $call[1]) { \ksort($resolvedArguments); - $arrayIsList = function (array $array) : bool { + $arrayIsListFunction = function (array $array) : bool { if (\function_exists('array_is_list')) { return \array_is_list($array); } @@ -110,7 +110,7 @@ protected function processValue($value, bool $isRoot = \false) } return \true; }; - if (!$value->isAutowired() && !$arrayIsList($resolvedArguments)) { + if (!$value->isAutowired() && !$arrayIsListFunction($resolvedArguments)) { \ksort($resolvedKeys); $resolvedArguments = \array_combine($resolvedKeys, $resolvedArguments); } diff --git a/vendor/symfony/dependency-injection/ContainerBuilder.php b/vendor/symfony/dependency-injection/ContainerBuilder.php index f7199b9ccd38..76beadd08b3a 100644 --- a/vendor/symfony/dependency-injection/ContainerBuilder.php +++ b/vendor/symfony/dependency-injection/ContainerBuilder.php @@ -881,7 +881,7 @@ private function createService(Definition $definition, array &$inlineServices, b if (null !== $id && $definition->isShared() && (isset($this->services[$id]) || isset($this->privates[$id])) && ($tryProxy || !$definition->isLazy())) { return $this->services[$id] ?? $this->privates[$id]; } - $arrayIsList = function (array $array) : bool { + $arrayIsListFunction = function (array $array) : bool { if (\function_exists('array_is_list')) { return \array_is_list($array); } @@ -897,7 +897,7 @@ private function createService(Definition $definition, array &$inlineServices, b } return \true; }; - if (!$arrayIsList($arguments)) { + if (!$arrayIsListFunction($arguments)) { $arguments = \array_combine(\array_map(function ($k) { return \preg_replace('/^.*\\$/', '', $k); }, \array_keys($arguments)), $arguments); diff --git a/vendor/symfony/dependency-injection/Dumper/XmlDumper.php b/vendor/symfony/dependency-injection/Dumper/XmlDumper.php index 70835b769106..43f2b8b778aa 100644 --- a/vendor/symfony/dependency-injection/Dumper/XmlDumper.php +++ b/vendor/symfony/dependency-injection/Dumper/XmlDumper.php @@ -229,7 +229,7 @@ private function addServices(\DOMElement $parent) } private function convertParameters(array $parameters, string $type, \DOMElement $parent, string $keyAttribute = 'key') { - $arrayIsList = function (array $array) : bool { + $arrayIsListFunction = function (array $array) : bool { if (\function_exists('array_is_list')) { return \array_is_list($array); } @@ -245,7 +245,7 @@ private function convertParameters(array $parameters, string $type, \DOMElement } return \true; }; - $withKeys = !$arrayIsList($parameters); + $withKeys = !$arrayIsListFunction($parameters); foreach ($parameters as $key => $value) { $element = $this->document->createElement($type); if ($withKeys) {