Skip to content

Commit

Permalink
Debugging message for ShouldNotHappenException in OptimizedDirectoryS…
Browse files Browse the repository at this point in the history
…ourceLocator
  • Loading branch information
ondrejmirtes committed Jun 21, 2020
1 parent 24246f3 commit f8a6cf1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function locateIdentifier(Reflector $reflector, Identifier $identifier):
}

if (!array_key_exists($className, $this->classNodes)) {
throw new \PHPStan\ShouldNotHappenException();
throw new \PHPStan\ShouldNotHappenException(sprintf('Class %s not found in file %s but was expected to be there.', $className, $file));
}

return $this->nodeToReflection($reflector, $this->classNodes[$className]);
Expand Down

0 comments on commit f8a6cf1

Please sign in to comment.