Skip to content

Commit 3ee96a4

Browse files
committed
Updated Rector to commit ce8575f35a2ea096e91223347074542c1e603742
rectorphp/rector-src@ce8575f Directly use isNames() in rector rules (#6896)
1 parent 19d2cf4 commit 3ee96a4

5 files changed

Lines changed: 22 additions & 10 deletions

File tree

vendor/composer/installed.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,12 +1866,12 @@
18661866
"source": {
18671867
"type": "git",
18681868
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
1869-
"reference": "78091395251ed1f7ae3f5e866162855cdd19365f"
1869+
"reference": "c910be4c9fa597df3a5ec7aec7fd6d71b35adb64"
18701870
},
18711871
"dist": {
18721872
"type": "zip",
1873-
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/78091395251ed1f7ae3f5e866162855cdd19365f",
1874-
"reference": "78091395251ed1f7ae3f5e866162855cdd19365f",
1873+
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/c910be4c9fa597df3a5ec7aec7fd6d71b35adb64",
1874+
"reference": "c910be4c9fa597df3a5ec7aec7fd6d71b35adb64",
18751875
"shasum": ""
18761876
},
18771877
"require": {
@@ -1900,7 +1900,7 @@
19001900
"tomasvotruba\/unused-public": "^2.0",
19011901
"tracy\/tracy": "^2.10"
19021902
},
1903-
"time": "2025-05-12T18:23:12+00:00",
1903+
"time": "2025-05-12T18:30:51+00:00",
19041904
"default-branch": true,
19051905
"type": "rector-extension",
19061906
"extra": {

vendor/composer/installed.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

vendor/rector/extension-installer/src/GeneratedConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
final class GeneratedConfig
1111
{
12-
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 0e1d06a'), '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 92b1b5b'), '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 76ce3a5'), '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 7809139'));
12+
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 0e1d06a'), '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 92b1b5b'), '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 76ce3a5'), '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 c910be4'));
1313
private function __construct()
1414
{
1515
}

vendor/rector/rector-symfony/rules/CodeQuality/Rector/Class_/EventListenerToEventSubscriberRector.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use PhpParser\Node\Identifier;
99
use PhpParser\Node\Name\FullyQualified;
1010
use PhpParser\Node\Stmt\Class_;
11+
use Rector\CodingStyle\Naming\ClassNaming;
1112
use Rector\Php80\NodeAnalyzer\PhpAttributeAnalyzer;
1213
use Rector\Rector\AbstractRector;
1314
use Rector\Symfony\ApplicationMetadata\ListenerServiceDefinitionProvider;
@@ -40,6 +41,10 @@ final class EventListenerToEventSubscriberRector extends AbstractRector
4041
* @readonly
4142
*/
4243
private PhpAttributeAnalyzer $phpAttributeAnalyzer;
44+
/**
45+
* @readonly
46+
*/
47+
private ClassNaming $classNaming;
4348
/**
4449
* @var string
4550
* @changelog https://regex101.com/r/qiHZ4T/1
@@ -49,12 +54,13 @@ final class EventListenerToEventSubscriberRector extends AbstractRector
4954
* @var EventNameToClassAndConstant[]
5055
*/
5156
private array $eventNamesToClassConstants = [];
52-
public function __construct(ListenerServiceDefinitionProvider $listenerServiceDefinitionProvider, GetSubscribedEventsClassMethodFactory $getSubscribedEventsClassMethodFactory, ClassAnalyzer $classAnalyzer, PhpAttributeAnalyzer $phpAttributeAnalyzer)
57+
public function __construct(ListenerServiceDefinitionProvider $listenerServiceDefinitionProvider, GetSubscribedEventsClassMethodFactory $getSubscribedEventsClassMethodFactory, ClassAnalyzer $classAnalyzer, PhpAttributeAnalyzer $phpAttributeAnalyzer, ClassNaming $classNaming)
5358
{
5459
$this->listenerServiceDefinitionProvider = $listenerServiceDefinitionProvider;
5560
$this->getSubscribedEventsClassMethodFactory = $getSubscribedEventsClassMethodFactory;
5661
$this->classAnalyzer = $classAnalyzer;
5762
$this->phpAttributeAnalyzer = $phpAttributeAnalyzer;
63+
$this->classNaming = $classNaming;
5864
$this->eventNamesToClassConstants = [
5965
// kernel events
6066
new EventNameToClassAndConstant('kernel.request', SymfonyClass::KERNEL_EVENTS_CLASS, 'REQUEST'),
@@ -140,7 +146,7 @@ public function refactor(Node $node) : ?Node
140146
private function changeListenerToSubscriberWithMethods(Class_ $class, array $eventsToMethods) : void
141147
{
142148
$class->implements[] = new FullyQualified(SymfonyClass::EVENT_SUBSCRIBER_INTERFACE);
143-
$classShortName = $this->nodeNameResolver->getShortName($class);
149+
$classShortName = $this->classNaming->getShortName($class);
144150
// remove suffix
145151
$classShortName = Strings::replace($classShortName, self::LISTENER_MATCH_REGEX, '$1');
146152
$class->name = new Identifier($classShortName . 'EventSubscriber');

vendor/rector/rector-symfony/rules/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use PhpParser\Node\Stmt\Class_;
1111
use PhpParser\Node\Stmt\ClassMethod;
1212
use PhpParser\Node\Stmt\Return_;
13+
use Rector\CodingStyle\Naming\ClassNaming;
1314
use Rector\PhpParser\Node\Value\ValueResolver;
1415
use Rector\Rector\AbstractRector;
1516
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
@@ -25,9 +26,14 @@ final class RemoveDefaultGetBlockPrefixRector extends AbstractRector
2526
* @readonly
2627
*/
2728
private ValueResolver $valueResolver;
28-
public function __construct(ValueResolver $valueResolver)
29+
/**
30+
* @readonly
31+
*/
32+
private ClassNaming $classNaming;
33+
public function __construct(ValueResolver $valueResolver, ClassNaming $classNaming)
2934
{
3035
$this->valueResolver = $valueResolver;
36+
$this->classNaming = $classNaming;
3137
}
3238
public function getRuleDefinition() : RuleDefinition
3339
{
@@ -86,7 +92,7 @@ public function refactor(Node $node) : ?Class_
8692
if (!\is_string($className)) {
8793
continue;
8894
}
89-
$shortClassName = $this->nodeNameResolver->getShortName($className);
95+
$shortClassName = $this->classNaming->getShortName($className);
9096
if (\substr_compare($shortClassName, 'Type', -\strlen('Type')) === 0) {
9197
$shortClassName = (string) Strings::before($shortClassName, 'Type');
9298
}

0 commit comments

Comments
 (0)