| Total Complexity | 5 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class DocumentNode extends AbstractNode |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var DefinitionNodeInterface[]|TypeExtensionNodeInterface[] |
||
| 11 | */ |
||
| 12 | protected $definitions; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * DocumentNode constructor. |
||
| 16 | * |
||
| 17 | * @param DefinitionNodeInterface[] $definitions |
||
| 18 | * @param Location|null $location |
||
| 19 | */ |
||
| 20 | public function __construct(array $definitions, ?Location $location) |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @return DefinitionNodeInterface[]|TypeExtensionNodeInterface[] |
||
| 29 | */ |
||
| 30 | public function getDefinitions(): array |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @return array |
||
| 37 | */ |
||
| 38 | public function getDefinitionsAST(): array |
||
| 39 | { |
||
| 40 | return \array_map(function (NodeInterface $node) { |
||
| 41 | return $node->toAST(); |
||
| 42 | }, $this->definitions); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @inheritdoc |
||
| 47 | */ |
||
| 48 | public function toAST(): array |
||
| 54 | ]; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @param DefinitionNodeInterface[] $definitions |
||
| 59 | * @return DocumentNode |
||
| 60 | */ |
||
| 61 | protected function setDefinitions(array $definitions): DocumentNode |
||
| 65 | } |
||
| 66 | } |
||
| 67 |