Skip to content

Commit 0b80789

Browse files
committed
fix: skip cases when class reflection is not found
1 parent ea73d1e commit 0b80789

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

rules/DeadCode/Rector/StaticCall/RemoveParentCallWithoutParentRector.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ private function isParentStaticCall(Expr $expr): bool
138138

139139
private function shouldSkipClass(Class_ $class): bool
140140
{
141+
// skip cases when class reflection is not found
142+
if (! $this->reflectionProvider->hasClass((string) $this->getName($class))) {
143+
return true;
144+
}
145+
141146
// skip cases when parent class reflection is not found
142147
if ($class->extends instanceof FullyQualified && ! $this->reflectionProvider->hasClass(
143148
$class->extends->toString()

0 commit comments

Comments
 (0)