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