Support class-string

This commit is contained in:
Ondrej Mirtes 2019-09-25 14:28:43 +02:00
parent 3067163e45
commit 3e956143ed
No known key found for this signature in database
GPG Key ID: 8E730BA25823D8B5
2 changed files with 61 additions and 1 deletions

View File

@ -147,7 +147,7 @@ class Lexer
self::TOKEN_SINGLE_QUOTED_STRING => '\'(?:\\\\[^\\r\\n]|[^\'\\r\\n\\\\])*+\'',
self::TOKEN_DOUBLE_QUOTED_STRING => '"(?:\\\\[^\\r\\n]|[^"\\r\\n\\\\])*+"',
self::TOKEN_IDENTIFIER => '(?:[\\\\]?+[a-z_\\x80-\\xFF][0-9a-z_\\x80-\\xFF]*+)++',
self::TOKEN_IDENTIFIER => '(?:[\\\\]?+[a-z_\\x80-\\xFF][0-9a-z_\\x80-\\xFF-]*+)++',
self::TOKEN_THIS_VARIABLE => '\\$this(?![0-9a-z_\\x80-\\xFF])',
self::TOKEN_VARIABLE => '\\$[a-z_\\x80-\\xFF][0-9a-z_\\x80-\\xFF]*+',

View File

@ -2508,6 +2508,66 @@ some text in the middle'
),
]),
];
yield [
'class-string in @return',
'/** @return class-string */',
new PhpDocNode([
new PhpDocTagNode(
'@return',
new ReturnTagValueNode(
new IdentifierTypeNode('class-string'),
''
)
),
]),
];
yield [
'class-string in @return with description',
'/** @return class-string some description */',
new PhpDocNode([
new PhpDocTagNode(
'@return',
new ReturnTagValueNode(
new IdentifierTypeNode('class-string'),
'some description'
)
),
]),
];
yield [
'class-string in @param',
'/** @param class-string $test */',
new PhpDocNode([
new PhpDocTagNode(
'@param',
new ParamTagValueNode(
new IdentifierTypeNode('class-string'),
false,
'$test',
''
)
),
]),
];
yield [
'class-string in @param with description',
'/** @param class-string $test some description */',
new PhpDocNode([
new PhpDocTagNode(
'@param',
new ParamTagValueNode(
new IdentifierTypeNode('class-string'),
false,
'$test',
'some description'
)
),
]),
];
}
public function providerDebug(): \Iterator