Conditions | 5 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function enterNode(NodeInterface $node): ?NodeInterface |
||
25 | { |
||
26 | if ($node instanceof DocumentNode) { |
||
27 | /** @var NamedTypeNode $definition */ |
||
28 | foreach ($node->getDefinitions() as $definition) { |
||
29 | if (!$definition instanceof ExecutableDefinitionNodeInterface) { |
||
30 | $this->validationContext->reportError( |
||
31 | new ValidationException( |
||
32 | nonExecutableDefinitionMessage( |
||
33 | $definition instanceof SchemaDefinitionNode ? 'schema' : $definition->getNameValue() |
||
34 | ), |
||
35 | [$definition] |
||
36 | ) |
||
37 | ); |
||
38 | } |
||
39 | } |
||
40 | } |
||
41 | |||
42 | return $node; |
||
43 | } |
||
45 |