From 844d7999c558777dddb83a35a984e442fd86c7e5 Mon Sep 17 00:00:00 2001 From: dennis Date: Tue, 13 Sep 2022 11:31:20 +0200 Subject: [PATCH] Ensure @throws annotations reference valid Exception classes --- .../Internal/FileManipulation/FunctionDocblockManipulator.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php b/src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php index ca652333e..6cc3c5946 100644 --- a/src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php +++ b/src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php @@ -405,6 +405,7 @@ class FunctionDocblockManipulator $inferredThrowsClause = array_reduce( $this->throwsExceptions, function (string $throwsClause, string $exception) { + $exception = '\\' . $exception; return $throwsClause === '' ? $exception : $throwsClause.'|'.$exception; }, ''