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