From 0b8078930f9d8b99751194900b6c8a09b9f1e0f9 Mon Sep 17 00:00:00 2001 From: Caleb White Date: Fri, 5 Dec 2025 20:43:06 -0600 Subject: [PATCH] fix: skip cases when class reflection is not found --- .../StaticCall/RemoveParentCallWithoutParentRector.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rules/DeadCode/Rector/StaticCall/RemoveParentCallWithoutParentRector.php b/rules/DeadCode/Rector/StaticCall/RemoveParentCallWithoutParentRector.php index c989a42642a..02f56f8b7ca 100644 --- a/rules/DeadCode/Rector/StaticCall/RemoveParentCallWithoutParentRector.php +++ b/rules/DeadCode/Rector/StaticCall/RemoveParentCallWithoutParentRector.php @@ -138,6 +138,11 @@ private function isParentStaticCall(Expr $expr): bool private function shouldSkipClass(Class_ $class): bool { + // skip cases when class reflection is not found + if (! $this->reflectionProvider->hasClass((string) $this->getName($class))) { + return true; + } + // skip cases when parent class reflection is not found if ($class->extends instanceof FullyQualified && ! $this->reflectionProvider->hasClass( $class->extends->toString()