Total Complexity | 4 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | class EnumValuesDefinitionASTBuilder extends AbstractASTBuilder |
||
11 | { |
||
12 | /** |
||
13 | * @inheritdoc |
||
14 | */ |
||
15 | public function supportsBuilder(string $kind): bool |
||
16 | { |
||
17 | return $kind === ASTKindEnum::ENUM_VALUES_DEFINITION; |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * @inheritdoc |
||
22 | */ |
||
23 | public function build(LexerInterface $lexer, array $params): ?array |
||
24 | { |
||
25 | return $this->peek($lexer, TokenKindEnum::BRACE_L) |
||
26 | ? $this->many( |
||
27 | $lexer, |
||
28 | TokenKindEnum::BRACE_L, |
||
29 | [$this, 'parseEnumValueDefinition'], |
||
30 | TokenKindEnum::BRACE_R |
||
31 | ) |
||
32 | : []; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @param LexerInterface $lexer |
||
37 | * @return array |
||
38 | * @throws SyntaxErrorException |
||
39 | */ |
||
40 | protected function parseEnumValueDefinition(LexerInterface $lexer): array |
||
50 | ]; |
||
51 | } |
||
52 | } |
||
53 |