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