mirror of
https://github.com/danog/phpdoc-parser.git
synced 2025-01-23 06:12:09 +01:00
Update Codestyle issues
This commit is contained in:
parent
b205ccdf21
commit
c8fef049d3
@ -164,17 +164,17 @@ class TypeParser
|
|||||||
|
|
||||||
public function parseGeneric(TokenIterator $tokens, Ast\Type\IdentifierTypeNode $baseType): Ast\Type\GenericTypeNode
|
public function parseGeneric(TokenIterator $tokens, Ast\Type\IdentifierTypeNode $baseType): Ast\Type\GenericTypeNode
|
||||||
{
|
{
|
||||||
$tokens->consumeTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET);
|
$tokens->consumeTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET);
|
||||||
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
||||||
$genericTypes = [$this->parse($tokens)];
|
$genericTypes = [$this->parse($tokens)];
|
||||||
|
|
||||||
while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)) {
|
while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)) {
|
||||||
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
||||||
$genericTypes[] = $this->parse($tokens);
|
$genericTypes[] = $this->parse($tokens);
|
||||||
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
||||||
$tokens->consumeTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET);
|
$tokens->consumeTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET);
|
||||||
|
|
||||||
return new Ast\Type\GenericTypeNode($baseType, $genericTypes);
|
return new Ast\Type\GenericTypeNode($baseType, $genericTypes);
|
||||||
|
@ -900,61 +900,61 @@ class TypeParserTest extends \PHPUnit\Framework\TestCase
|
|||||||
]),
|
]),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'array<' . PHP_EOL .
|
'array<' . PHP_EOL .
|
||||||
' Foo' . PHP_EOL .
|
' Foo' . PHP_EOL .
|
||||||
'>',
|
'>',
|
||||||
new GenericTypeNode(
|
new GenericTypeNode(
|
||||||
new IdentifierTypeNode('array'),
|
new IdentifierTypeNode('array'),
|
||||||
[
|
[
|
||||||
new IdentifierTypeNode('Foo')
|
new IdentifierTypeNode('Foo'),
|
||||||
]
|
]
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'array<' . PHP_EOL .
|
'array<' . PHP_EOL .
|
||||||
' Foo,' . PHP_EOL .
|
' Foo,' . PHP_EOL .
|
||||||
' Bar' . PHP_EOL .
|
' Bar' . PHP_EOL .
|
||||||
'>',
|
'>',
|
||||||
new GenericTypeNode(
|
new GenericTypeNode(
|
||||||
new IdentifierTypeNode('array'),
|
new IdentifierTypeNode('array'),
|
||||||
[
|
[
|
||||||
new IdentifierTypeNode('Foo'),
|
new IdentifierTypeNode('Foo'),
|
||||||
new IdentifierTypeNode('Bar'),
|
new IdentifierTypeNode('Bar'),
|
||||||
]
|
]
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'array<' . PHP_EOL .
|
'array<' . PHP_EOL .
|
||||||
' Foo, Bar' . PHP_EOL .
|
' Foo, Bar' . PHP_EOL .
|
||||||
'>',
|
'>',
|
||||||
new GenericTypeNode(
|
new GenericTypeNode(
|
||||||
new IdentifierTypeNode('array'),
|
new IdentifierTypeNode('array'),
|
||||||
[
|
[
|
||||||
new IdentifierTypeNode('Foo'),
|
new IdentifierTypeNode('Foo'),
|
||||||
new IdentifierTypeNode('Bar'),
|
new IdentifierTypeNode('Bar'),
|
||||||
]
|
]
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'array<' . PHP_EOL .
|
'array<' . PHP_EOL .
|
||||||
' Foo,' . PHP_EOL .
|
' Foo,' . PHP_EOL .
|
||||||
' array<' . PHP_EOL .
|
' array<' . PHP_EOL .
|
||||||
' Bar' . PHP_EOL .
|
' Bar' . PHP_EOL .
|
||||||
' >' . PHP_EOL .
|
' >' . PHP_EOL .
|
||||||
'>',
|
'>',
|
||||||
new GenericTypeNode(
|
new GenericTypeNode(
|
||||||
new IdentifierTypeNode('array'),
|
new IdentifierTypeNode('array'),
|
||||||
[
|
[
|
||||||
new IdentifierTypeNode('Foo'),
|
new IdentifierTypeNode('Foo'),
|
||||||
new GenericTypeNode(
|
new GenericTypeNode(
|
||||||
new IdentifierTypeNode('array'),
|
new IdentifierTypeNode('array'),
|
||||||
[
|
[
|
||||||
new IdentifierTypeNode('Bar')
|
new IdentifierTypeNode('Bar'),
|
||||||
]
|
]
|
||||||
)
|
),
|
||||||
]
|
]
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user