mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Allow commas at the end of @param lines
This commit is contained in:
parent
2e4aa3d3b1
commit
1bf0882bfc
@ -132,7 +132,7 @@ class CommentChecker
|
||||
if (count($line_parts) > 1) {
|
||||
if (preg_match('/^' . self::TYPE_REGEX . '$/', $line_parts[0])
|
||||
&& !preg_match('/\[[^\]]+\]/', $line_parts[0])
|
||||
&& preg_match('/^(\.\.\.)?&?\$[A-Za-z0-9_]+$/', $line_parts[1])
|
||||
&& preg_match('/^(\.\.\.)?&?\$[A-Za-z0-9_]+,?$/', $line_parts[1])
|
||||
&& !strpos($line_parts[0], '::')
|
||||
&& $line_parts[0][0] !== '{'
|
||||
) {
|
||||
@ -140,6 +140,8 @@ class CommentChecker
|
||||
$line_parts[1] = substr($line_parts[1], 1);
|
||||
}
|
||||
|
||||
$line_parts[1] = preg_replace('/,$/', '', $line_parts[1]);
|
||||
|
||||
$info->params[] = [
|
||||
'name' => $line_parts[1],
|
||||
'type' => $line_parts[0],
|
||||
|
Loading…
Reference in New Issue
Block a user