mirror of
https://github.com/danog/phpdoc-parser.git
synced 2025-01-22 22:01:36 +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
|
||||
{
|
||||
$tokens->consumeTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET);
|
||||
$tokens->consumeTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET);
|
||||
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
||||
$genericTypes = [$this->parse($tokens)];
|
||||
|
||||
while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)) {
|
||||
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
||||
$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL);
|
||||
$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);
|
||||
|
||||
return new Ast\Type\GenericTypeNode($baseType, $genericTypes);
|
||||
|
@ -900,61 +900,61 @@ class TypeParserTest extends \PHPUnit\Framework\TestCase
|
||||
]),
|
||||
],
|
||||
[
|
||||
'array<' . PHP_EOL .
|
||||
' Foo' . PHP_EOL .
|
||||
'>',
|
||||
new GenericTypeNode(
|
||||
new IdentifierTypeNode('array'),
|
||||
[
|
||||
new IdentifierTypeNode('Foo')
|
||||
]
|
||||
)
|
||||
],
|
||||
[
|
||||
'array<' . PHP_EOL .
|
||||
' Foo,' . PHP_EOL .
|
||||
' Bar' . PHP_EOL .
|
||||
'>',
|
||||
new GenericTypeNode(
|
||||
new IdentifierTypeNode('array'),
|
||||
[
|
||||
new IdentifierTypeNode('Foo'),
|
||||
new IdentifierTypeNode('Bar'),
|
||||
]
|
||||
)
|
||||
],
|
||||
[
|
||||
'array<' . PHP_EOL .
|
||||
' Foo, Bar' . PHP_EOL .
|
||||
'>',
|
||||
new GenericTypeNode(
|
||||
new IdentifierTypeNode('array'),
|
||||
[
|
||||
new IdentifierTypeNode('Foo'),
|
||||
new IdentifierTypeNode('Bar'),
|
||||
]
|
||||
)
|
||||
],
|
||||
[
|
||||
'array<' . PHP_EOL .
|
||||
' Foo,' . PHP_EOL .
|
||||
' array<' . PHP_EOL .
|
||||
' Bar' . PHP_EOL .
|
||||
' >' . PHP_EOL .
|
||||
'>',
|
||||
new GenericTypeNode(
|
||||
new IdentifierTypeNode('array'),
|
||||
[
|
||||
new IdentifierTypeNode('Foo'),
|
||||
new GenericTypeNode(
|
||||
new IdentifierTypeNode('array'),
|
||||
[
|
||||
new IdentifierTypeNode('Bar')
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
],
|
||||
'array<' . PHP_EOL .
|
||||
' Foo' . PHP_EOL .
|
||||
'>',
|
||||
new GenericTypeNode(
|
||||
new IdentifierTypeNode('array'),
|
||||
[
|
||||
new IdentifierTypeNode('Foo'),
|
||||
]
|
||||
),
|
||||
],
|
||||
[
|
||||
'array<' . PHP_EOL .
|
||||
' Foo,' . PHP_EOL .
|
||||
' Bar' . PHP_EOL .
|
||||
'>',
|
||||
new GenericTypeNode(
|
||||
new IdentifierTypeNode('array'),
|
||||
[
|
||||
new IdentifierTypeNode('Foo'),
|
||||
new IdentifierTypeNode('Bar'),
|
||||
]
|
||||
),
|
||||
],
|
||||
[
|
||||
'array<' . PHP_EOL .
|
||||
' Foo, Bar' . PHP_EOL .
|
||||
'>',
|
||||
new GenericTypeNode(
|
||||
new IdentifierTypeNode('array'),
|
||||
[
|
||||
new IdentifierTypeNode('Foo'),
|
||||
new IdentifierTypeNode('Bar'),
|
||||
]
|
||||
),
|
||||
],
|
||||
[
|
||||
'array<' . PHP_EOL .
|
||||
' Foo,' . PHP_EOL .
|
||||
' array<' . PHP_EOL .
|
||||
' Bar' . PHP_EOL .
|
||||
' >' . PHP_EOL .
|
||||
'>',
|
||||
new GenericTypeNode(
|
||||
new IdentifierTypeNode('array'),
|
||||
[
|
||||
new IdentifierTypeNode('Foo'),
|
||||
new GenericTypeNode(
|
||||
new IdentifierTypeNode('array'),
|
||||
[
|
||||
new IdentifierTypeNode('Bar'),
|
||||
]
|
||||
),
|
||||
]
|
||||
),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user