Skip to content
Permalink
Browse files

Fix stubbing in end-to-end tests

  • Loading branch information
muglug committed Nov 14, 2019
1 parent a5c3304 commit 939be92f2919510dc0e1703c89e42e0527874852
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/Psalm/Internal/Visitor/ReflectorVisitor.php
@@ -665,7 +665,9 @@ public function leaveNode(PhpParser\Node $node)
}
if (!$this->functionlike_storages) {
throw new \UnexpectedValueException('There should be function storages');
throw new \UnexpectedValueException(
'There should be function storages for line ' . $this->file_path . ':' . $node->getLine()
);
}
$functionlike_storage = array_pop($this->functionlike_storages);
@@ -1557,7 +1559,10 @@ private function registerFunctionLike(PhpParser\Node\FunctionLike $stmt, $fake_m
$this->file_storage->functions[$function_id]
);
return $this->file_storage->functions[$function_id];
$storage = $this->file_storage->functions[$function_id];
$this->functionlike_storages[] = $storage;
return $storage;
}
} else {
if (isset($this->file_storage->functions[$function_id])) {

0 comments on commit 939be92

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