Skip to content

Commit 5952f38

Browse files
committed
Updated Rector to commit ce6c838b696e3c92602de0ef63a7a10c5a036b53
rectorphp/rector-src@ce6c838 fix: Skip attribute decorated parameters in `RemoveParentDelegatingConstructorRector` (#7900)
1 parent 5c2c9cd commit 5952f38

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

rules/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ public function refactor(Node $node): ?int
115115
if (!$this->areConstructorAndParentParameterTypesMatching($node, $parentMethodReflection)) {
116116
return null;
117117
}
118+
if ($this->doAttributeDecoratedParametersExist($node)) {
119+
return null;
120+
}
118121
return NodeVisitor::REMOVE_NODE;
119122
}
120123
private function matchParentConstructorReflection(ClassMethod $classMethod): ?ExtendedMethodReflection
@@ -236,4 +239,16 @@ private function isDifferentDefaultValue(Expr $defaultExpr, ExtendedMethodReflec
236239
}
237240
return \false;
238241
}
242+
private function doAttributeDecoratedParametersExist(ClassMethod $classMethod): bool
243+
{
244+
$constructorParams = $classMethod->getParams();
245+
foreach ($constructorParams as $constructorParam) {
246+
foreach ($constructorParam->attrGroups as $attrGroup) {
247+
if ($attrGroup->attrs !== []) {
248+
return \true;
249+
}
250+
}
251+
}
252+
return \false;
253+
}
239254
}

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 = 'd31f656f7f8dfb2e8ee4db3369688037b85fda82';
22+
public const PACKAGE_VERSION = 'ce6c838b696e3c92602de0ef63a7a10c5a036b53';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2026-02-18 19:56:15';
27+
public const RELEASE_DATE = '2026-02-19 11:04:24';
2828
/**
2929
* @var int
3030
*/

0 commit comments

Comments
 (0)