Skip to content

Commit d882f47

Browse files
authored
Fix exception in case of non-existent class (#28)
1 parent 1461d89 commit d882f47

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Collector/MethodCallCollector.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,15 @@ private function registerStaticCall(
113113
$callerType = $scope->getType($staticCall->class);
114114
$classReflections = $this->getReflectionsWithMethod($callerType, $methodName);
115115
} else {
116-
$classReflections = [
117-
$this->reflectionProvider->getClass($scope->resolveName($staticCall->class)),
118-
];
116+
$className = $scope->resolveName($staticCall->class);
117+
118+
if ($this->reflectionProvider->hasClass($className)) {
119+
$classReflections = [
120+
$this->reflectionProvider->getClass($className),
121+
];
122+
} else {
123+
$classReflections = [];
124+
}
119125
}
120126

121127
$result = [];

0 commit comments

Comments
 (0)