diff --git a/rules-tests/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector/Fixture/skip_private_property_promotion.php.inc b/rules-tests/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector/Fixture/skip_private_property_promotion.php.inc new file mode 100644 index 00000000000..22a98dd1e6a --- /dev/null +++ b/rules-tests/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector/Fixture/skip_private_property_promotion.php.inc @@ -0,0 +1,18 @@ +d->format('Y-m-d'); + } +} diff --git a/rules-tests/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector/Source/SomeParentWithPrivatePropertyPromotion.php b/rules-tests/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector/Source/SomeParentWithPrivatePropertyPromotion.php new file mode 100644 index 00000000000..731284c25ee --- /dev/null +++ b/rules-tests/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector/Source/SomeParentWithPrivatePropertyPromotion.php @@ -0,0 +1,12 @@ +getParams() as $position => $param) { + if ($param->isPromoted() && $param->isPrivate()) { + return false; + } + $parameterType = $param->type; // no type override