From 1543cccc5612e0f94e0b8d23f36ca0e3a60a129a Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Wed, 13 Sep 2023 19:21:21 +0000 Subject: [PATCH] Updated Rector to commit 299d02c41ec1a0850c5a5449e27f9cf9fd44b5e5 https://github.com/rectorphp/rector-src/commit/299d02c41ec1a0850c5a5449e27f9cf9fd44b5e5 [Performance][BetterPhpDocParser] Move create new PhpDocNodeTraverser() to __construct() on PhpDocNodeMapper (#5014) --- .../BetterPhpDocParser/PhpDocNodeMapper.php | 31 +++++++------------ src/Application/VersionResolver.php | 4 +-- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +++--- vendor/composer/autoload_static.php | 8 ++--- 5 files changed, 24 insertions(+), 31 deletions(-) diff --git a/packages/BetterPhpDocParser/PhpDocNodeMapper.php b/packages/BetterPhpDocParser/PhpDocNodeMapper.php index 098cbaafac6..9e2a1d97ae4 100644 --- a/packages/BetterPhpDocParser/PhpDocNodeMapper.php +++ b/packages/BetterPhpDocParser/PhpDocNodeMapper.php @@ -21,41 +21,34 @@ final class PhpDocNodeMapper * @var \Rector\BetterPhpDocParser\DataProvider\CurrentTokenIteratorProvider */ private $currentTokenIteratorProvider; - /** - * @readonly - * @var \Rector\PhpDocParser\PhpDocParser\PhpDocNodeVisitor\ParentConnectingPhpDocNodeVisitor - */ - private $parentConnectingPhpDocNodeVisitor; - /** - * @readonly - * @var \Rector\PhpDocParser\PhpDocParser\PhpDocNodeVisitor\CloningPhpDocNodeVisitor - */ - private $cloningPhpDocNodeVisitor; /** * @var BasePhpDocNodeVisitorInterface[] * @readonly */ private $phpDocNodeVisitors; + /** + * @readonly + * @var \Rector\PhpDocParser\PhpDocParser\PhpDocNodeTraverser + */ + private $phpDocNodeTraverser; /** * @param BasePhpDocNodeVisitorInterface[] $phpDocNodeVisitors */ public function __construct(CurrentTokenIteratorProvider $currentTokenIteratorProvider, ParentConnectingPhpDocNodeVisitor $parentConnectingPhpDocNodeVisitor, CloningPhpDocNodeVisitor $cloningPhpDocNodeVisitor, array $phpDocNodeVisitors) { $this->currentTokenIteratorProvider = $currentTokenIteratorProvider; - $this->parentConnectingPhpDocNodeVisitor = $parentConnectingPhpDocNodeVisitor; - $this->cloningPhpDocNodeVisitor = $cloningPhpDocNodeVisitor; $this->phpDocNodeVisitors = $phpDocNodeVisitors; Assert::notEmpty($phpDocNodeVisitors); + $this->phpDocNodeTraverser = new PhpDocNodeTraverser(); + $this->phpDocNodeTraverser->addPhpDocNodeVisitor($parentConnectingPhpDocNodeVisitor); + $this->phpDocNodeTraverser->addPhpDocNodeVisitor($cloningPhpDocNodeVisitor); + foreach ($this->phpDocNodeVisitors as $phpDocNodeVisitor) { + $this->phpDocNodeTraverser->addPhpDocNodeVisitor($phpDocNodeVisitor); + } } public function transform(PhpDocNode $phpDocNode, BetterTokenIterator $betterTokenIterator) : void { $this->currentTokenIteratorProvider->setBetterTokenIterator($betterTokenIterator); - $phpDocNodeTraverser = new PhpDocNodeTraverser(); - $phpDocNodeTraverser->addPhpDocNodeVisitor($this->parentConnectingPhpDocNodeVisitor); - $phpDocNodeTraverser->addPhpDocNodeVisitor($this->cloningPhpDocNodeVisitor); - foreach ($this->phpDocNodeVisitors as $phpDocNodeVisitor) { - $phpDocNodeTraverser->addPhpDocNodeVisitor($phpDocNodeVisitor); - } - $phpDocNodeTraverser->traverse($phpDocNode); + $this->phpDocNodeTraverser->traverse($phpDocNode); } } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 50e84c072ef..fe4c65ab2d9 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 = '74df7741a7d0798888d2d9a3bf1020746b80ad8e'; + public const PACKAGE_VERSION = '299d02c41ec1a0850c5a5449e27f9cf9fd44b5e5'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-09-13 19:28:39'; + public const RELEASE_DATE = '2023-09-14 02:18:43'; /** * @var int */ diff --git a/vendor/autoload.php b/vendor/autoload.php index 9bf69a7c024..9db8e95a915 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitfc60864e8baa406f3cb1a7a1afef9c9e::getLoader(); +return ComposerAutoloaderInit4f8152579cbe1ab8bc70c0536c7bb55c::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 4a725ce157c..4dbd6b4f608 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitfc60864e8baa406f3cb1a7a1afef9c9e +class ComposerAutoloaderInit4f8152579cbe1ab8bc70c0536c7bb55c { private static $loader; @@ -22,17 +22,17 @@ class ComposerAutoloaderInitfc60864e8baa406f3cb1a7a1afef9c9e return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitfc60864e8baa406f3cb1a7a1afef9c9e', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit4f8152579cbe1ab8bc70c0536c7bb55c', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitfc60864e8baa406f3cb1a7a1afef9c9e', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit4f8152579cbe1ab8bc70c0536c7bb55c', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitfc60864e8baa406f3cb1a7a1afef9c9e::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit4f8152579cbe1ab8bc70c0536c7bb55c::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInitfc60864e8baa406f3cb1a7a1afef9c9e::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit4f8152579cbe1ab8bc70c0536c7bb55c::$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 2193f457da8..7d705065ba2 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitfc60864e8baa406f3cb1a7a1afef9c9e +class ComposerStaticInit4f8152579cbe1ab8bc70c0536c7bb55c { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -2593,9 +2593,9 @@ class ComposerStaticInitfc60864e8baa406f3cb1a7a1afef9c9e public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitfc60864e8baa406f3cb1a7a1afef9c9e::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitfc60864e8baa406f3cb1a7a1afef9c9e::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitfc60864e8baa406f3cb1a7a1afef9c9e::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit4f8152579cbe1ab8bc70c0536c7bb55c::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit4f8152579cbe1ab8bc70c0536c7bb55c::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit4f8152579cbe1ab8bc70c0536c7bb55c::$classMap; }, null, ClassLoader::class); }