diff --git a/src/Psalm/Internal/Analyzer/CommentAnalyzer.php b/src/Psalm/Internal/Analyzer/CommentAnalyzer.php index 73b598d32..3eeb5cf04 100644 --- a/src/Psalm/Internal/Analyzer/CommentAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/CommentAnalyzer.php @@ -281,6 +281,8 @@ class CommentAnalyzer } $var_line = preg_replace('/[ \t]+/', ' ', preg_replace('@^[ \t]*\*@m', '', $var_line)); + $var_line = preg_replace('/,\n\s+\}/', '}', $var_line); + $var_line = str_replace("\n", '', $var_line); $var_line_parts = preg_split('/( |=)/', $var_line, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); diff --git a/tests/AnnotationTest.php b/tests/AnnotationTest.php index 3a1a0924f..0853a4808 100644 --- a/tests/AnnotationTest.php +++ b/tests/AnnotationTest.php @@ -989,6 +989,17 @@ class AnnotationTest extends TestCase ], 'allowClosingComma' => [ '