| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function build(LexerInterface $lexer, array $params): ?array |
||
| 23 | { |
||
| 24 | $start = $lexer->getToken(); |
||
| 25 | |||
| 26 | $this->expectKeyword($lexer, KeywordEnum::EXTEND); |
||
| 27 | $this->expectKeyword($lexer, KeywordEnum::SCALAR); |
||
| 28 | |||
| 29 | $name = $this->buildAST(ASTKindEnum::NAME, $lexer); |
||
| 30 | $directives = $this->buildAST(ASTKindEnum::DIRECTIVES, $lexer); |
||
| 31 | |||
| 32 | if (count($directives) === 0) { |
||
| 33 | throw $this->unexpected($lexer); |
||
| 34 | } |
||
| 35 | |||
| 36 | return [ |
||
| 37 | 'kind' => NodeKindEnum::SCALAR_TYPE_EXTENSION, |
||
| 38 | 'name' => $name, |
||
| 39 | 'directives' => $directives, |
||
| 40 | 'loc' => $this->buildLocation($lexer, $start), |
||
| 41 | ]; |
||
| 44 |