From 817d0bf15ff3bcaf76c8989886cb851db0e77a9b Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 7 Jan 2025 02:33:24 +0700 Subject: [PATCH] [DeadCode] Skip dynamic name on RemoveParentCallWithoutParentRector --- .../Fixture/skip_dynamic_call.php.inc | 13 +++++++++++++ .../RemoveParentCallWithoutParentRector.php | 4 ++++ 2 files changed, 17 insertions(+) create mode 100644 rules-tests/DeadCode/Rector/StaticCall/RemoveParentCallWithoutParentRector/Fixture/skip_dynamic_call.php.inc diff --git a/rules-tests/DeadCode/Rector/StaticCall/RemoveParentCallWithoutParentRector/Fixture/skip_dynamic_call.php.inc b/rules-tests/DeadCode/Rector/StaticCall/RemoveParentCallWithoutParentRector/Fixture/skip_dynamic_call.php.inc new file mode 100644 index 00000000000..de5ee7afd8e --- /dev/null +++ b/rules-tests/DeadCode/Rector/StaticCall/RemoveParentCallWithoutParentRector/Fixture/skip_dynamic_call.php.inc @@ -0,0 +1,13 @@ +name instanceof Expr) { + return false; + } + return $this->isName($expr->class, ObjectReference::PARENT); }