1
0
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:
Matthew Brown 2017-01-28 00:37:52 -07:00
parent 2e4aa3d3b1
commit 1bf0882bfc

View File

@ -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],