From b25a22b57560c9ef1b6f8c2757d76c243eac43ac Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 6 Aug 2026 16:08:39 +0200 Subject: [PATCH] [DeadCode] Skip RemoveParentDelegatingConstructorRector on protected parent constructor --- .../Fixture/skip_protected_parent_construct.php.inc | 13 +++++++++++++ .../Source/ProtectedConstructClass.php | 12 ++++++++++++ .../RemoveParentDelegatingConstructorRector.php | 5 +++++ 3 files changed, 30 insertions(+) create mode 100644 rules-tests/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector/Fixture/skip_protected_parent_construct.php.inc create mode 100644 rules-tests/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector/Source/ProtectedConstructClass.php diff --git a/rules-tests/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector/Fixture/skip_protected_parent_construct.php.inc b/rules-tests/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector/Fixture/skip_protected_parent_construct.php.inc new file mode 100644 index 00000000000..e86ca95a2b2 --- /dev/null +++ b/rules-tests/DeadCode/Rector/ClassMethod/RemoveParentDelegatingConstructorRector/Fixture/skip_protected_parent_construct.php.inc @@ -0,0 +1,13 @@ +isPublic()) { + return null; + } + $soleStmt = $node->stmts[0]; $parentCallArgs = $this->matchParentConstructorCallArgs($soleStmt); if ($parentCallArgs === null) {