Update Codestyle issues

This commit is contained in:
Andreas Frömer 2020-05-04 15:15:33 +02:00 committed by Ondřej Mirtes
parent b205ccdf21
commit c8fef049d3
2 changed files with 59 additions and 59 deletions

View File

@ -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);

View File

@ -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'),
] ]
) ),
] ]
) ),
], ],
]; ];
} }