Total Complexity | 3 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class DirectiveDefinitionNode extends AbstractNode implements DefinitionNodeInterface |
||
13 | { |
||
14 | |||
15 | use DescriptionTrait; |
||
16 | use NameTrait; |
||
17 | use ArgumentsTrait; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $kind = NodeKindEnum::DIRECTIVE_DEFINITION; |
||
23 | |||
24 | /** |
||
25 | * @var NameNode[] |
||
26 | */ |
||
27 | protected $locations; |
||
28 | |||
29 | /** |
||
30 | * @return NameNode[] |
||
31 | */ |
||
32 | public function getLocations(): array |
||
33 | { |
||
34 | return $this->locations; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @return array |
||
39 | */ |
||
40 | public function getLocationsAsArray(): array |
||
41 | { |
||
42 | return array_map(function (SerializationInterface $node) { |
||
43 | return $node->toArray(); |
||
44 | }, $this->locations); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * @inheritdoc |
||
49 | */ |
||
50 | public function toArray(): array |
||
59 | ]; |
||
60 | } |
||
61 | } |
||
62 |