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()