Skip to content

Commit

Permalink
Fixed 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 17, 2022
1 parent f1b0c23 commit 13c4730
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Reflection/ReflectionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,15 @@ private function resolveFunctionReflectionFromFuncCall(

if ($funcCall->name instanceof Name) {
if ($this->reflectionProvider->hasFunction($funcCall->name, $scope)) {
return $this->reflectionProvider->getFunction($funcCall->name, $scope);
$function = $this->reflectionProvider->getFunction($funcCall->name, $scope);
$fileName = (string) $function->getFileName();

// function inside phpstan.phar may conflict with defined function
if (str_contains($fileName, 'phpstan.phar')) {
return null;
}

return $function;
}

return null;
Expand Down

0 comments on commit 13c4730

Please sign in to comment.