From f8a6cf15af670871596ff36bbdd14a6826811980 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Sun, 21 Jun 2020 10:48:04 +0200 Subject: [PATCH] Debugging message for ShouldNotHappenException in OptimizedDirectorySourceLocator --- .../SourceLocator/OptimizedDirectorySourceLocator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocator.php b/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocator.php index 3035f6fb81..20d9804832 100644 --- a/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocator.php +++ b/src/Reflection/BetterReflection/SourceLocator/OptimizedDirectorySourceLocator.php @@ -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]);