Skip to content

Commit 5dc9b2b

Browse files
committed
Updated Rector to commit 9929af7c0179929b4fde6915cb7a06c3141dde6c
rectorphp/rector-src@9929af7 Try bump php-scoper to 0.18.17 (#7230)
1 parent 798815e commit 5dc9b2b

5 files changed

Lines changed: 32 additions & 25 deletions

File tree

vendor/composer/installed.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,8 @@
507507
},
508508
{
509509
"name": "illuminate\/container",
510-
"version": "v11.45.3",
511-
"version_normalized": "11.45.3.0",
510+
"version": "v11.46.0",
511+
"version_normalized": "11.46.0.0",
512512
"source": {
513513
"type": "git",
514514
"url": "https:\/\/github.com\/illuminate\/container.git",
@@ -564,8 +564,8 @@
564564
},
565565
{
566566
"name": "illuminate\/contracts",
567-
"version": "v11.45.3",
568-
"version_normalized": "11.45.3.0",
567+
"version": "v11.46.0",
568+
"version_normalized": "11.46.0.0",
569569
"source": {
570570
"type": "git",
571571
"url": "https:\/\/github.com\/illuminate\/contracts.git",
@@ -1685,12 +1685,12 @@
16851685
"source": {
16861686
"type": "git",
16871687
"url": "https:\/\/github.com\/rectorphp\/rector-doctrine.git",
1688-
"reference": "4efe5217ded739452bc3c18a20fb85a3091e6647"
1688+
"reference": "787002f318824ddda0a2aa00e11ace97ef9e1e5d"
16891689
},
16901690
"dist": {
16911691
"type": "zip",
1692-
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/4efe5217ded739452bc3c18a20fb85a3091e6647",
1693-
"reference": "4efe5217ded739452bc3c18a20fb85a3091e6647",
1692+
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/787002f318824ddda0a2aa00e11ace97ef9e1e5d",
1693+
"reference": "787002f318824ddda0a2aa00e11ace97ef9e1e5d",
16941694
"shasum": ""
16951695
},
16961696
"require": {
@@ -1713,7 +1713,7 @@
17131713
"tomasvotruba\/class-leak": "^2.0",
17141714
"tracy\/tracy": "^2.10"
17151715
},
1716-
"time": "2025-09-08T21:06:48+00:00",
1716+
"time": "2025-09-08T22:26:01+00:00",
17171717
"default-branch": true,
17181718
"type": "rector-extension",
17191719
"extra": {
@@ -1746,12 +1746,12 @@
17461746
"source": {
17471747
"type": "git",
17481748
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
1749-
"reference": "35a459d15ed536e8f623d431e2d554c61b9d85db"
1749+
"reference": "757bfc884573955309427ae0d16f7af634cac90c"
17501750
},
17511751
"dist": {
17521752
"type": "zip",
1753-
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/35a459d15ed536e8f623d431e2d554c61b9d85db",
1754-
"reference": "35a459d15ed536e8f623d431e2d554c61b9d85db",
1753+
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/757bfc884573955309427ae0d16f7af634cac90c",
1754+
"reference": "757bfc884573955309427ae0d16f7af634cac90c",
17551755
"shasum": ""
17561756
},
17571757
"require": {
@@ -1769,7 +1769,7 @@
17691769
"tomasvotruba\/class-leak": "^1.0",
17701770
"tracy\/tracy": "^2.10"
17711771
},
1772-
"time": "2025-09-08T18:23:00+00:00",
1772+
"time": "2025-09-09T12:06:45+00:00",
17731773
"default-branch": true,
17741774
"type": "rector-extension",
17751775
"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 4efe521'), '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 35a459d'), '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 eafbe16'), '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 afd86d7'));
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 787002f'), '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 757bfc8'), '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 eafbe16'), '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 afd86d7'));
1313
private function __construct()
1414
{
1515
}

vendor/rector/rector-doctrine/rules/Bundle230/Rector/Class_/AddAnnotationToRepositoryRector.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,26 @@ public function getNodeTypes(): array
8181
*/
8282
public function refactor(Node $node): ?Node
8383
{
84-
if (!$this->isRepositoryClass($node)) {
84+
$repositoryClass = $this->matchServiceRepositoryClass($node);
85+
if ($repositoryClass === null) {
8586
return null;
8687
}
8788
$entityClass = $this->getEntityClassFromConstructor($node);
8889
if ($entityClass === null || $this->hasExtendsAnnotation($node)) {
8990
return null;
9091
}
91-
$this->addAnnotationToNode($node, $entityClass);
92+
$this->addAnnotationToNode($node, $entityClass, $repositoryClass);
9293
return $node;
9394
}
94-
private function isRepositoryClass(Class_ $class): bool
95+
private function matchServiceRepositoryClass(Class_ $class): ?string
9596
{
9697
if (!$class->extends instanceof Name) {
97-
return \false;
98+
return null;
9899
}
99-
if ($this->isName($class->extends, DoctrineClass::SERVICE_ENTITY_REPOSITORY)) {
100-
return \true;
100+
if (!$this->isNames($class->extends, [DoctrineClass::SERVICE_ENTITY_REPOSITORY, DoctrineClass::SERVICE_DOCUMENT_REPOSITORY])) {
101+
return null;
101102
}
102-
return $this->isName($class->extends, DoctrineClass::SERVICE_DOCUMENT_REPOSITORY);
103+
return $this->getName($class->extends);
103104
}
104105
private function getEntityClassFromConstructor(Class_ $class): ?string
105106
{
@@ -127,10 +128,10 @@ private function getEntityClassFromConstructor(Class_ $class): ?string
127128
}
128129
return null;
129130
}
130-
private function addAnnotationToNode(Class_ $class, string $entityClass): void
131+
private function addAnnotationToNode(Class_ $class, string $entityClass, string $repositoryClass): void
131132
{
132133
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($class);
133-
$genericsAnnotation = sprintf('\%s<\%s>', DoctrineClass::SERVICE_ENTITY_REPOSITORY, $entityClass);
134+
$genericsAnnotation = sprintf('\%s<\%s>', $repositoryClass, $entityClass);
134135
$phpDocInfo->addPhpDocTagNode(new PhpDocTagNode('@extends', new GenericTagValueNode($genericsAnnotation)));
135136
$this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($class);
136137
}

vendor/rector/rector-downgrade-php/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ final class DowngradeAttributeToAnnotationRector extends AbstractRector implemen
4444
/**
4545
* @var string[]
4646
*/
47-
private const SKIPPED_ATTRIBUTES = ['Attribute', 'ReturnTypeWillChange', 'AllowDynamicProperties'];
47+
private const SKIPPED_ATTRIBUTES = ['Attribute', 'ReturnTypeWillChange', 'AllowDynamicProperties', 'Override'];
4848
/**
4949
* @var DowngradeAttributeToAnnotation[]
5050
*/
@@ -106,8 +106,14 @@ public function refactor(Node $node): ?Node
106106
foreach ($attrGroup->attrs as $key => $attribute) {
107107
if ($this->shouldSkipAttribute($attribute)) {
108108
if (isset($oldTokens[$attrGroup->getEndTokenPos() + 1]) && strpos((string) $oldTokens[$attrGroup->getEndTokenPos() + 1], "\n") === \false) {
109+
if ($node->getStartTokenPos() === strlen($attribute->name->toString()) - 2) {
110+
$indentation = '';
111+
} else {
112+
$indent = $attrGroup->getEndTokenPos() - $node->getStartTokenPos() + 2;
113+
$indentation = $indent > 0 ? str_repeat(' ', $indent) : '';
114+
}
109115
// add new line
110-
$oldTokens[$attrGroup->getEndTokenPos() + 1]->text = "\n" . $oldTokens[$attrGroup->getEndTokenPos() + 1]->text;
116+
$oldTokens[$attrGroup->getEndTokenPos() + 1]->text = "\n" . $indentation . $oldTokens[$attrGroup->getEndTokenPos() + 1]->text;
111117
$this->isDowngraded = \true;
112118
}
113119
continue;

0 commit comments

Comments
 (0)