diff --git a/src/Psalm/Internal/Analyzer/CommentAnalyzer.php b/src/Psalm/Internal/Analyzer/CommentAnalyzer.php index 34898c6a044..db29cfd6ea4 100644 --- a/src/Psalm/Internal/Analyzer/CommentAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/CommentAnalyzer.php @@ -280,7 +280,7 @@ public static function splitDocLine(string $return_block): array $last_char = $i > 0 ? $return_block[$i - 1] : null; if ($quote_char) { - if ($char === $quote_char && $i > 1 && !$escaped) { + if ($char === $quote_char && !$escaped) { $quote_char = null; $type .= $char; diff --git a/tests/AnnotationTest.php b/tests/AnnotationTest.php index c4a3c43222e..5835fb94041 100644 --- a/tests/AnnotationTest.php +++ b/tests/AnnotationTest.php @@ -1201,6 +1201,15 @@ function takesFlags(int $flags) : void { takesFlags(FileFlag::MODIFIED | FileFlag::NEW);' ], + 'emptyStringFirst' => [ + '