Updated Rector to commit aa66151ff14da601b4b155f4a876ad2a2070259c

aa66151ff1 [Performance] Remove unnecessary FunctionLikeParamPositionNodeVisitor (#5491)
This commit is contained in:
Tomas Votruba 2024-01-22 15:14:12 +00:00
parent c36d19ef56
commit 76ce6b58bb
4 changed files with 20 additions and 8 deletions

View File

@ -1866,12 +1866,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
"reference": "e52eac8e1998ace8f632e5f4a3034bca841b75a5"
"reference": "9772f7ab4e335fce7624d0ebd7a993ad96b58de8"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/e52eac8e1998ace8f632e5f4a3034bca841b75a5",
"reference": "e52eac8e1998ace8f632e5f4a3034bca841b75a5",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/9772f7ab4e335fce7624d0ebd7a993ad96b58de8",
"reference": "9772f7ab4e335fce7624d0ebd7a993ad96b58de8",
"shasum": ""
},
"require": {
@ -1900,7 +1900,7 @@
"tomasvotruba\/class-leak": "^0.2.6",
"tracy\/tracy": "^2.10"
},
"time": "2024-01-22T12:48:59+00:00",
"time": "2024-01-22T15:10:17+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main b419ce7'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 51ff6e7'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main f091938'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main e52eac8'));
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main b419ce7'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 51ff6e7'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main f091938'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 9772f7a'));
private function __construct()
{
}

View File

@ -12,6 +12,7 @@ use Rector\BetterPhpDocParser\PhpDoc\StringNode;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
use Rector\BetterPhpDocParser\PhpDocParser\StaticDoctrineAnnotationParser\ArrayParser;
use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNode;
use Rector\Comments\NodeDocBlock\DocBlockUpdater;
use Rector\Rector\AbstractRector;
use Rector\Symfony\Contract\Bridge\Symfony\Routing\SymfonyRoutesProviderInterface;
use Rector\Symfony\Enum\SymfonyAnnotation;
@ -44,12 +45,18 @@ final class AddRouteAnnotationRector extends AbstractRector
* @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory
*/
private $phpDocInfoFactory;
public function __construct(SymfonyRoutesProviderInterface $symfonyRoutesProvider, SymfonyRouteTagValueNodeFactory $symfonyRouteTagValueNodeFactory, ArrayParser $arrayParser, PhpDocInfoFactory $phpDocInfoFactory)
/**
* @readonly
* @var \Rector\Comments\NodeDocBlock\DocBlockUpdater
*/
private $docBlockUpdater;
public function __construct(SymfonyRoutesProviderInterface $symfonyRoutesProvider, SymfonyRouteTagValueNodeFactory $symfonyRouteTagValueNodeFactory, ArrayParser $arrayParser, PhpDocInfoFactory $phpDocInfoFactory, DocBlockUpdater $docBlockUpdater)
{
$this->symfonyRoutesProvider = $symfonyRoutesProvider;
$this->symfonyRouteTagValueNodeFactory = $symfonyRouteTagValueNodeFactory;
$this->arrayParser = $arrayParser;
$this->phpDocInfoFactory = $phpDocInfoFactory;
$this->docBlockUpdater = $docBlockUpdater;
}
public function getNodeTypes() : array
{
@ -82,7 +89,11 @@ final class AddRouteAnnotationRector extends AbstractRector
continue;
}
// skip if already has an annotation
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($classMethod);
try {
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($classMethod);
} catch (\TypeError $exception) {
continue;
}
$doctrineAnnotationTagValueNode = $phpDocInfo->getByAnnotationClass(SymfonyAnnotation::ROUTE);
if ($doctrineAnnotationTagValueNode instanceof DoctrineAnnotationTagValueNode) {
continue;
@ -93,6 +104,7 @@ final class AddRouteAnnotationRector extends AbstractRector
$phpDocInfo->addTagValueNode($symfonyRouteTagValueNode);
}
$hasChanged = \true;
$this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($classMethod);
}
if ($hasChanged) {
return $node;