Conditions | 5 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public function enterNode(NodeInterface $node): ?NodeInterface |
||
21 | { |
||
22 | if ($node instanceof OperationDefinitionNode) { |
||
23 | if ($node->getOperation() === 'subscription') { |
||
24 | $selectionSet = $node->getSelectionSet(); |
||
25 | if (null !== $selectionSet) { |
||
26 | $selections = $selectionSet->getSelections(); |
||
27 | if (\count($selections) !== 1) { |
||
28 | $this->validationContext->reportError( |
||
29 | new ValidationException( |
||
30 | singleFieldOnlyMessage((string)$node), |
||
31 | \array_slice($selections, 1) |
||
32 | ) |
||
33 | ); |
||
34 | } |
||
35 | } |
||
36 | } |
||
37 | } |
||
38 | |||
39 | return $node; |
||
40 | } |
||
42 |