Skip to content

Commit

Permalink
Fix exception in case of non-existent class (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar authored Jul 4, 2024
1 parent 1461d89 commit d882f47
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Collector/MethodCallCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,15 @@ private function registerStaticCall(
$callerType = $scope->getType($staticCall->class);
$classReflections = $this->getReflectionsWithMethod($callerType, $methodName);
} else {
$classReflections = [
$this->reflectionProvider->getClass($scope->resolveName($staticCall->class)),
];
$className = $scope->resolveName($staticCall->class);

if ($this->reflectionProvider->hasClass($className)) {
$classReflections = [
$this->reflectionProvider->getClass($className),
];
} else {
$classReflections = [];
}
}

$result = [];
Expand Down

0 comments on commit d882f47

Please sign in to comment.