mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix #3270 - support multiple spaces before @param
This commit is contained in:
parent
29741cd76d
commit
2ce65e1d03
@ -203,7 +203,7 @@ class DocComment
|
||||
|
||||
$last = false;
|
||||
foreach ($lines as $k => $line) {
|
||||
if (preg_match('/^[ \t]*\*?\s?@\w/i', $line)) {
|
||||
if (preg_match('/^[ \t]*\*?\s*@\w/i', $line)) {
|
||||
$last = $k;
|
||||
} elseif (preg_match('/^\s*\r?$/', $line)) {
|
||||
$last = false;
|
||||
@ -222,7 +222,7 @@ class DocComment
|
||||
|
||||
$line = str_replace("\r", '', $line);
|
||||
|
||||
if (preg_match('/^[ \t]*\*?\s?@([\w\-:]+)[\t ]*(.*)$/sm', $line, $matches, PREG_OFFSET_CAPTURE)) {
|
||||
if (preg_match('/^[ \t]*\*?\s*@([\w\-:]+)[\t ]*(.*)$/sm', $line, $matches, PREG_OFFSET_CAPTURE)) {
|
||||
/** @var array<int, array{string, int}> $matches */
|
||||
list($full_match_info, $type_info, $data_info) = $matches;
|
||||
|
||||
|
@ -1136,6 +1136,13 @@ class AnnotationTest extends TestCase
|
||||
'$arr' => 'array{\'foo\\\\bar\nbaz\': string}'
|
||||
]
|
||||
],
|
||||
'doubleSpaceBeforeAt' => [
|
||||
'<?php
|
||||
/**
|
||||
* @param string $c
|
||||
*/
|
||||
function foo($c) : void {}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user