Skip to content
Permalink
Browse files

Fix re-added function storage removal

  • Loading branch information
muglug committed Nov 14, 2019
1 parent b693b72 commit 738ce4f850d9259e4e2a57a7a31e25cf280d0539
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/Psalm/Internal/Visitor/ReflectorVisitor.php
@@ -1571,7 +1571,10 @@ private function registerFunctionLike(PhpParser\Node\FunctionLike $stmt, $fake_m
if ($duplicate_function_storage->location
&& $duplicate_function_storage->location->getLineNumber() === $stmt->getLine()
) {
return $this->file_storage->functions[$function_id];
$storage = $this->file_storage->functions[$function_id];
$this->functionlike_storages[] = $storage;
return $storage;
}
if (IssueBuffer::accepts(
@@ -1590,8 +1593,13 @@ private function registerFunctionLike(PhpParser\Node\FunctionLike $stmt, $fake_m
$duplicate_function_storage->has_visitor_issues = true;
return $this->file_storage->functions[$function_id];
} elseif (isset($this->config->getPredefinedFunctions()[$function_id])) {
$storage = $this->file_storage->functions[$function_id];
$this->functionlike_storages[] = $storage;
return $storage;
}
if (isset($this->config->getPredefinedFunctions()[$function_id])) {
/** @psalm-suppress TypeCoercion */
$reflection_function = new \ReflectionFunction($function_id);

0 comments on commit 738ce4f

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