1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Ensure comment lines are terminated with a new line character (\n).

This commit is contained in:
rhertogh 2023-07-15 19:00:28 +02:00
parent f378ef1cab
commit c362dd5af7

View File

@ -332,6 +332,9 @@ class CommentAnalyzer
if ($char === '/' && $next_char === '/') {
// Ignore the rest of the current line
$i = strpos($return_block, "\n", $i);
if ($i === false) {
Throw new IncorrectDocblockException('Comment lines must be terminated with a new line character (\\n).');
}
// Remove trailing whitespaces (needed for `sanitizeDocblockType`)
$type = rtrim($type);