Updated Rector to commit 8b8a0d1a5daa1064860c446bdd1f8a26ab06c20d

8b8a0d1a5d Prevent unnecessary calls to spl_object_id() (#4992)
This commit is contained in:
Tomas Votruba 2023-09-11 14:30:03 +00:00
parent 8a7560aff0
commit 8b577a6b5e
9 changed files with 30 additions and 20 deletions

View File

@ -49,7 +49,7 @@ final class CallableNodeVisitor extends NodeVisitorAbstract
*/
public function leaveNode(Node $node)
{
if ($this->nodeIdToRemove === \spl_object_id($node)) {
if ($this->nodeIdToRemove !== null && $this->nodeIdToRemove === \spl_object_id($node)) {
$this->nodeIdToRemove = null;
return NodeTraverser::REMOVE_NODE;
}

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'b26175631cdad7feac444fac351120541ef3fa03';
public const PACKAGE_VERSION = '8b8a0d1a5daa1064860c446bdd1f8a26ab06c20d';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-09-11 16:07:37';
public const RELEASE_DATE = '2023-09-11 16:27:17';
/**
* @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 ComposerAutoloaderInit7af9d114e8d27258d58b8c416707d348::getLoader();
return ComposerAutoloaderInit361546f389097fb22bba64e5b918c68e::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit7af9d114e8d27258d58b8c416707d348
class ComposerAutoloaderInit361546f389097fb22bba64e5b918c68e
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInit7af9d114e8d27258d58b8c416707d348
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit7af9d114e8d27258d58b8c416707d348', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit361546f389097fb22bba64e5b918c68e', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit7af9d114e8d27258d58b8c416707d348', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit361546f389097fb22bba64e5b918c68e', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit7af9d114e8d27258d58b8c416707d348::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit361546f389097fb22bba64e5b918c68e::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit7af9d114e8d27258d58b8c416707d348::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit361546f389097fb22bba64e5b918c68e::$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 ComposerStaticInit7af9d114e8d27258d58b8c416707d348
class ComposerStaticInit361546f389097fb22bba64e5b918c68e
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -2595,9 +2595,9 @@ class ComposerStaticInit7af9d114e8d27258d58b8c416707d348
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit7af9d114e8d27258d58b8c416707d348::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit7af9d114e8d27258d58b8c416707d348::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit7af9d114e8d27258d58b8c416707d348::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit361546f389097fb22bba64e5b918c68e::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit361546f389097fb22bba64e5b918c68e::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit361546f389097fb22bba64e5b918c68e::$classMap;
}, null, ClassLoader::class);
}

View File

@ -1943,12 +1943,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
"reference": "44e77e55a40c384ef8e01e6e483152fa09e6da23"
"reference": "63f14d3034dca068762066ff72da4924ee697a85"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/44e77e55a40c384ef8e01e6e483152fa09e6da23",
"reference": "44e77e55a40c384ef8e01e6e483152fa09e6da23",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/63f14d3034dca068762066ff72da4924ee697a85",
"reference": "63f14d3034dca068762066ff72da4924ee697a85",
"shasum": ""
},
"require": {
@ -1981,7 +1981,7 @@
"tomasvotruba\/unused-public": "^0.2",
"tracy\/tracy": "^2.10"
},
"time": "2023-09-11T08:34:17+00:00",
"time": "2023-09-11T14:24:54+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/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main 41cefd3'), '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' => NULL, 'version' => 'dev-main 74058c2'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 5629065'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 44e77e5'));
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' => NULL, 'version' => 'dev-main 41cefd3'), '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' => NULL, 'version' => 'dev-main 74058c2'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 5629065'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 63f14d3'));
private function __construct()
{
}

View File

@ -7,6 +7,7 @@ use PhpParser\Node;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassMethod;
use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
use Rector\Comments\NodeDocBlock\DocBlockUpdater;
use Rector\Core\Rector\AbstractRector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
@ -15,6 +16,15 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
*/
final class RemoveServiceFromSensioRouteRector extends AbstractRector
{
/**
* @readonly
* @var \Rector\Comments\NodeDocBlock\DocBlockUpdater
*/
private $docBlockUpdater;
public function __construct(DocBlockUpdater $docBlockUpdater)
{
$this->docBlockUpdater = $docBlockUpdater;
}
public function getRuleDefinition() : RuleDefinition
{
return new RuleDefinition('Remove service from Sensio @Route', [new CodeSample(<<<'CODE_SAMPLE'
@ -63,7 +73,7 @@ CODE_SAMPLE
return null;
}
$doctrineAnnotationTagValueNode->removeValue('service');
$phpDocInfo->markAsChanged();
$this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($node);
return $node;
}
}