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