From eb050eb1bb4948c766996028f48b86da2c6b6e9c Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 29 May 2021 20:14:45 +0000 Subject: [PATCH] Updated Rector to commit 763bce6c57f4ad1b3a6c421ce0a56d9219f1c9e2 https://github.com/rectorphp/rector-src/commit/763bce6c57f4ad1b3a6c421ce0a56d9219f1c9e2 [PHP 8.0] Add class const reference to PhpAttributeGroupFactory (#122) --- .../Printer/PhpAttributeGroupFactory.php | 10 +++++++++- src/Application/VersionResolver.php | 4 ++-- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 14 +++++++------- vendor/composer/autoload_static.php | 8 ++++---- vendor/scoper-autoload.php | 10 +++++----- 6 files changed, 28 insertions(+), 20 deletions(-) diff --git a/packages/PhpAttribute/Printer/PhpAttributeGroupFactory.php b/packages/PhpAttribute/Printer/PhpAttributeGroupFactory.php index bb14ef7196fe..993c11d62e4e 100644 --- a/packages/PhpAttribute/Printer/PhpAttributeGroupFactory.php +++ b/packages/PhpAttribute/Printer/PhpAttributeGroupFactory.php @@ -7,7 +7,10 @@ use PhpParser\Node\Arg; use PhpParser\Node\Attribute; use PhpParser\Node\AttributeGroup; +use PhpParser\Node\Expr; +use PhpParser\Node\Expr\ClassConstFetch; use PhpParser\Node\Identifier; +use PhpParser\Node\Name; use PhpParser\Node\Name\FullyQualified; use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprFalseNode; use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprIntegerNode; @@ -71,7 +74,7 @@ private function isArrayArguments(array $items) : bool } /** * @param mixed $value - * @return bool|float|int|string|array + * @return bool|float|int|string|array|Expr */ private function normalizeNodeValue($value) { @@ -95,6 +98,11 @@ private function normalizeNodeValue($value) return $this->normalizeNodeValue($node); }, $value->getValuesWithExplicitSilentAndWithoutQuotes()); } + if (\is_string($value) && \strpos($value, '::') !== \false) { + // class const fetch + [$class, $constant] = \explode('::', $value); + return new \PhpParser\Node\Expr\ClassConstFetch(new \PhpParser\Node\Name($class), $constant); + } if ($value instanceof \PHPStan\PhpDocParser\Ast\Node) { return (string) $value; } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 59fc1274d710..35be2a80fb6a 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -16,11 +16,11 @@ final class VersionResolver /** * @var string */ - public const PACKAGE_VERSION = '4c5f678ca4c1d42846a80d8677718d3ac88026c9'; + public const PACKAGE_VERSION = '763bce6c57f4ad1b3a6c421ce0a56d9219f1c9e2'; /** * @var string */ - public const RELEASE_DATE = '2021-05-29 19:06:26'; + public const RELEASE_DATE = '2021-05-29 22:02:52'; public static function resolvePackageVersion() : string { $process = new \RectorPrefix20210529\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__); diff --git a/vendor/autoload.php b/vendor/autoload.php index 9d27a0c48e67..332936121862 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitb03907ce8f77d8a6e3d4f5730e144d84::getLoader(); +return ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 37e8a80d8a4d..5f87a119f0d2 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitb03907ce8f77d8a6e3d4f5730e144d84 +class ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f { private static $loader; @@ -22,15 +22,15 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitb03907ce8f77d8a6e3d4f5730e144d84', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); - spl_autoload_unregister(array('ComposerAutoloaderInitb03907ce8f77d8a6e3d4f5730e144d84', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f', '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\ComposerStaticInitb03907ce8f77d8a6e3d4f5730e144d84::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit337f58b2e3b250842c3babd1f071fc6f::getInitializer($loader)); } else { $classMap = require __DIR__ . '/autoload_classmap.php'; if ($classMap) { @@ -42,19 +42,19 @@ public static function getLoader() $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInitb03907ce8f77d8a6e3d4f5730e144d84::$files; + $includeFiles = Composer\Autoload\ComposerStaticInit337f58b2e3b250842c3babd1f071fc6f::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequireb03907ce8f77d8a6e3d4f5730e144d84($fileIdentifier, $file); + composerRequire337f58b2e3b250842c3babd1f071fc6f($fileIdentifier, $file); } return $loader; } } -function composerRequireb03907ce8f77d8a6e3d4f5730e144d84($fileIdentifier, $file) +function composerRequire337f58b2e3b250842c3babd1f071fc6f($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 17e8b54dbc6e..d703e5036680 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitb03907ce8f77d8a6e3d4f5730e144d84 +class ComposerStaticInit337f58b2e3b250842c3babd1f071fc6f { public static $files = array ( 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', @@ -3824,9 +3824,9 @@ class ComposerStaticInitb03907ce8f77d8a6e3d4f5730e144d84 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitb03907ce8f77d8a6e3d4f5730e144d84::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitb03907ce8f77d8a6e3d4f5730e144d84::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitb03907ce8f77d8a6e3d4f5730e144d84::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit337f58b2e3b250842c3babd1f071fc6f::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit337f58b2e3b250842c3babd1f071fc6f::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit337f58b2e3b250842c3babd1f071fc6f::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/scoper-autoload.php b/vendor/scoper-autoload.php index bd571e0a976e..9508e285a082 100644 --- a/vendor/scoper-autoload.php +++ b/vendor/scoper-autoload.php @@ -21,8 +21,8 @@ if (!class_exists('CheckoutEntityFactory', false) && !interface_exists('CheckoutEntityFactory', false) && !trait_exists('CheckoutEntityFactory', false)) { spl_autoload_call('RectorPrefix20210529\CheckoutEntityFactory'); } -if (!class_exists('ComposerAutoloaderInitb03907ce8f77d8a6e3d4f5730e144d84', false) && !interface_exists('ComposerAutoloaderInitb03907ce8f77d8a6e3d4f5730e144d84', false) && !trait_exists('ComposerAutoloaderInitb03907ce8f77d8a6e3d4f5730e144d84', false)) { - spl_autoload_call('RectorPrefix20210529\ComposerAutoloaderInitb03907ce8f77d8a6e3d4f5730e144d84'); +if (!class_exists('ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f', false) && !interface_exists('ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f', false) && !trait_exists('ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f', false)) { + spl_autoload_call('RectorPrefix20210529\ComposerAutoloaderInit337f58b2e3b250842c3babd1f071fc6f'); } if (!class_exists('Doctrine\Inflector\Inflector', false) && !interface_exists('Doctrine\Inflector\Inflector', false) && !trait_exists('Doctrine\Inflector\Inflector', false)) { spl_autoload_call('RectorPrefix20210529\Doctrine\Inflector\Inflector'); @@ -3320,9 +3320,9 @@ function print_node() { return \RectorPrefix20210529\print_node(...func_get_args()); } } -if (!function_exists('composerRequireb03907ce8f77d8a6e3d4f5730e144d84')) { - function composerRequireb03907ce8f77d8a6e3d4f5730e144d84() { - return \RectorPrefix20210529\composerRequireb03907ce8f77d8a6e3d4f5730e144d84(...func_get_args()); +if (!function_exists('composerRequire337f58b2e3b250842c3babd1f071fc6f')) { + function composerRequire337f58b2e3b250842c3babd1f071fc6f() { + return \RectorPrefix20210529\composerRequire337f58b2e3b250842c3babd1f071fc6f(...func_get_args()); } } if (!function_exists('parseArgs')) {