Updated Rector to commit 299d02c41ec1a0850c5a5449e27f9cf9fd44b5e5

299d02c41e [Performance][BetterPhpDocParser] Move create new PhpDocNodeTraverser() to __construct() on PhpDocNodeMapper (#5014)
This commit is contained in:
Tomas Votruba 2023-09-13 19:21:21 +00:00
parent 2331f6b39c
commit 1543cccc56
5 changed files with 24 additions and 31 deletions

View File

@ -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);
}
}

View File

@ -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
*/

2
vendor/autoload.php vendored
View File

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

View File

@ -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;

View File

@ -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);
}