mirror of
https://github.com/danog/phpdoc-parser.git
synced 2025-01-22 13:51:20 +01:00
Support class-string
This commit is contained in:
parent
3067163e45
commit
3e956143ed
@ -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]*+',
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user