Skip to content

Commit 0e8bc21

Browse files
committed
Updated Rector to commit 1fd4615de691eb43a3f47a60cf14028247ca9d24
rectorphp/rector-src@1fd4615 Rectify (#6856)
1 parent 1b9283a commit 0e8bc21

File tree

6 files changed

+42
-42
lines changed

6 files changed

+42
-42
lines changed

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = '25944daa5f2b31d7c4f2833ab31c8970140c596b';
22+
public const PACKAGE_VERSION = '1fd4615de691eb43a3f47a60cf14028247ca9d24';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2025-04-22 17:15:36';
27+
public const RELEASE_DATE = '2025-04-22 10:24:46';
2828
/**
2929
* @var int
3030
*/

src/NodeManipulator/ClassDependencyManipulator.php

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -85,38 +85,6 @@ public function __construct(\Rector\NodeManipulator\ClassInsertManipulator $clas
8585
$this->reflectionResolver = $reflectionResolver;
8686
$this->astResolver = $astResolver;
8787
}
88-
private function resolveConstruct(Class_ $class) : ?ClassMethod
89-
{
90-
/** @var ClassMethod|null $constructorMethod */
91-
$constructorMethod = $class->getMethod(MethodName::CONSTRUCT);
92-
// exists in current class
93-
if ($constructorMethod instanceof ClassMethod) {
94-
return $constructorMethod;
95-
}
96-
// lookup parent, found first found (nearest parent constructor to follow)
97-
$classReflection = $this->reflectionResolver->resolveClassReflection($class);
98-
if (!$classReflection instanceof ClassReflection) {
99-
return null;
100-
}
101-
$ancestors = \array_filter($classReflection->getAncestors(), static fn(ClassReflection $ancestor): bool => $ancestor->getName() !== $classReflection->getName());
102-
foreach ($ancestors as $ancestor) {
103-
if (!$ancestor->hasNativeMethod(MethodName::CONSTRUCT)) {
104-
continue;
105-
}
106-
$parentClass = $this->astResolver->resolveClassFromClassReflection($ancestor);
107-
if (!$parentClass instanceof ClassLike) {
108-
continue;
109-
}
110-
$parentConstructorMethod = $parentClass->getMethod(MethodName::CONSTRUCT);
111-
if (!$parentConstructorMethod instanceof ClassMethod) {
112-
continue;
113-
}
114-
// reprint parent method node to avoid invalid tokens
115-
$this->nodeFactory->createReprintedNode($parentConstructorMethod);
116-
return $parentConstructorMethod;
117-
}
118-
return null;
119-
}
12088
public function addConstructorDependency(Class_ $class, PropertyMetadata $propertyMetadata) : void
12189
{
12290
// already has property as dependency? skip it
@@ -192,6 +160,38 @@ public function addStmtsToConstructorIfNotThereYet(Class_ $class, array $stmts)
192160
}
193161
$classMethod->stmts = \array_merge($stmts, (array) $classMethod->stmts);
194162
}
163+
private function resolveConstruct(Class_ $class) : ?ClassMethod
164+
{
165+
/** @var ClassMethod|null $constructorMethod */
166+
$constructorMethod = $class->getMethod(MethodName::CONSTRUCT);
167+
// exists in current class
168+
if ($constructorMethod instanceof ClassMethod) {
169+
return $constructorMethod;
170+
}
171+
// lookup parent, found first found (nearest parent constructor to follow)
172+
$classReflection = $this->reflectionResolver->resolveClassReflection($class);
173+
if (!$classReflection instanceof ClassReflection) {
174+
return null;
175+
}
176+
$ancestors = \array_filter($classReflection->getAncestors(), static fn(ClassReflection $ancestor): bool => $ancestor->getName() !== $classReflection->getName());
177+
foreach ($ancestors as $ancestor) {
178+
if (!$ancestor->hasNativeMethod(MethodName::CONSTRUCT)) {
179+
continue;
180+
}
181+
$parentClass = $this->astResolver->resolveClassFromClassReflection($ancestor);
182+
if (!$parentClass instanceof ClassLike) {
183+
continue;
184+
}
185+
$parentConstructorMethod = $parentClass->getMethod(MethodName::CONSTRUCT);
186+
if (!$parentConstructorMethod instanceof ClassMethod) {
187+
continue;
188+
}
189+
// reprint parent method node to avoid invalid tokens
190+
$this->nodeFactory->createReprintedNode($parentConstructorMethod);
191+
return $parentConstructorMethod;
192+
}
193+
return null;
194+
}
195195
private function addPromotedProperty(Class_ $class, PropertyMetadata $propertyMetadata, ?ClassMethod $constructClassMethod) : void
196196
{
197197
$param = $this->nodeFactory->createPromotedPropertyParam($propertyMetadata);

vendor/composer/installed.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,12 +1864,12 @@
18641864
"source": {
18651865
"type": "git",
18661866
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
1867-
"reference": "9b807485a017c4becf5b7d6f93e05a1597700b0a"
1867+
"reference": "fc00253be624ef24a4f3ad7df177dfa4af28a476"
18681868
},
18691869
"dist": {
18701870
"type": "zip",
1871-
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/9b807485a017c4becf5b7d6f93e05a1597700b0a",
1872-
"reference": "9b807485a017c4becf5b7d6f93e05a1597700b0a",
1871+
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/fc00253be624ef24a4f3ad7df177dfa4af28a476",
1872+
"reference": "fc00253be624ef24a4f3ad7df177dfa4af28a476",
18731873
"shasum": ""
18741874
},
18751875
"require": {
@@ -1882,7 +1882,7 @@
18821882
"phpstan\/phpstan": "^2.1.8",
18831883
"phpstan\/phpstan-webmozart-assert": "^2.0",
18841884
"phpunit\/phpunit": "^11.4",
1885-
"rector\/rector-src": "dev-follow-empty-param",
1885+
"rector\/rector-src": "dev-main",
18861886
"rector\/type-perfect": "^2.0",
18871887
"symfony\/config": "^6.4",
18881888
"symfony\/dependency-injection": "^6.4",
@@ -1897,7 +1897,7 @@
18971897
"tomasvotruba\/unused-public": "^2.0",
18981898
"tracy\/tracy": "^2.10"
18991899
},
1900-
"time": "2025-04-22T10:14:14+00:00",
1900+
"time": "2025-04-22T10:16:52+00:00",
19011901
"default-branch": true,
19021902
"type": "rector-extension",
19031903
"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 c923389'), '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 a719629'), '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 6f67935'), '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 9b80748'));
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 c923389'), '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 a719629'), '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 6f67935'), '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 fc00253'));
1313
private function __construct()
1414
{
1515
}

vendor/rector/rector-symfony/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"phpstan\/phpstan": "^2.1.8",
1414
"phpstan\/phpstan-webmozart-assert": "^2.0",
1515
"phpunit\/phpunit": "^11.4",
16-
"rector\/rector-src": "dev-follow-empty-param",
16+
"rector\/rector-src": "dev-main",
1717
"rector\/type-perfect": "^2.0",
1818
"symfony\/config": "^6.4",
1919
"symfony\/dependency-injection": "^6.4",

0 commit comments

Comments
 (0)