| Total Complexity | 3 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class NonNullTypeNode extends AbstractNode implements TypeNodeInterface |
||
| 8 | { |
||
| 9 | use TypeTrait; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * NonNullTypeNode constructor. |
||
| 13 | * |
||
| 14 | * @param TypeNodeInterface $type |
||
| 15 | * @param Location|null $location |
||
| 16 | */ |
||
| 17 | public function __construct(TypeNodeInterface $type, ?Location $location) |
||
| 18 | { |
||
| 19 | parent::__construct(NodeKindEnum::NON_NULL_TYPE, $location); |
||
| 20 | |||
| 21 | $this->type = $type; |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @inheritdoc |
||
| 26 | */ |
||
| 27 | public function toAST(): array |
||
| 28 | { |
||
| 29 | return [ |
||
| 30 | 'kind' => $this->kind, |
||
| 31 | 'type' => $this->getTypeAST(), |
||
| 32 | 'loc' => $this->getLocationAST(), |
||
| 33 | ]; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @inheritdoc |
||
| 38 | */ |
||
| 39 | public function __toString(): string |
||
| 42 | } |
||
| 43 | } |
||
| 44 |