mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Fix #1799 - support trailing commas in type aliases
This commit is contained in:
parent
8a1067e4e6
commit
06f7df9974
@ -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);
|
||||
|
||||
|
@ -989,6 +989,17 @@ class AnnotationTest extends TestCase
|
||||
],
|
||||
'allowClosingComma' => [
|
||||
'<?php
|
||||
/**
|
||||
* @psalm-type _Alias=array{
|
||||
* foo: string,
|
||||
* bar: string,
|
||||
* baz: array{
|
||||
* a: int,
|
||||
* },
|
||||
* }
|
||||
*/
|
||||
class Foo { }
|
||||
|
||||
/**
|
||||
* @param array{
|
||||
* foo: string,
|
||||
|
Loading…
x
Reference in New Issue
Block a user