Skip to content
Permalink
Browse files

Fix #1564 - scan functions if they’re not internal

  • Loading branch information...
muglug committed Apr 20, 2019
1 parent 79ae72d commit ec65197f41b6cfd7afe035336c6c85d70182ef9b
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/Psalm/Internal/Visitor/ReflectorVisitor.php
@@ -411,12 +411,10 @@ public function enterNode(PhpParser\Node $node)
) {
$reflection_function = new \ReflectionFunction($node->cond->expr->args[0]->value->value);
if ($reflection_function->getFileName() !== $this->file_path) {
if ($reflection_function->isInternal()) {
return PhpParser\NodeTraverser::DONT_TRAVERSE_CHILDREN;
}
}
if ($node->cond->expr->name->parts === ['class_exists']
} elseif ($node->cond->expr->name->parts === ['class_exists']
&& isset($node->cond->expr->args[0])
&& $node->cond->expr->args[0]->value instanceof PhpParser\Node\Scalar\String_
&& class_exists($node->cond->expr->args[0]->value->value, false)

0 comments on commit ec65197

Please sign in to comment.
You can’t perform that action at this time.