| Total Complexity | 4 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class SelectionSetASTBuilder extends AbstractASTBuilder |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @inheritdoc |
||
| 14 | */ |
||
| 15 | public function supportsBuilder(string $kind): bool |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @inheritdoc |
||
| 22 | */ |
||
| 23 | public function build(LexerInterface $lexer, array $params): ?array |
||
| 24 | { |
||
| 25 | $start = $lexer->getToken(); |
||
| 26 | |||
| 27 | return [ |
||
| 28 | 'kind' => NodeKindEnum::SELECTION_SET, |
||
| 29 | 'selections' => $this->many( |
||
| 30 | $lexer, |
||
| 31 | TokenKindEnum::BRACE_L, |
||
| 32 | [$this, 'parseSelection'], |
||
| 33 | TokenKindEnum::BRACE_R |
||
| 34 | ), |
||
| 35 | 'loc' => $this->buildLocation($lexer, $start), |
||
| 36 | ]; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param LexerInterface $lexer |
||
| 41 | * @return array |
||
| 42 | * @throws SyntaxErrorException |
||
| 43 | */ |
||
| 44 | protected function parseSelection(LexerInterface $lexer): array |
||
| 49 | } |
||
| 50 | } |
||
| 51 |