| Conditions | 4 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function enterNode(NodeInterface $node): ?NodeInterface |
||
| 26 | { |
||
| 27 | if ($node instanceof OperationDefinitionNode) { |
||
| 28 | $operationName = $node->getNameValue(); |
||
| 29 | |||
| 30 | if (null !== $operationName) { |
||
| 31 | if (isset($this->knownOperationNames[$operationName])) { |
||
| 32 | $this->validationContext->reportError( |
||
| 33 | new ValidationException( |
||
| 34 | duplicateOperationMessage($operationName), |
||
| 35 | [$this->knownOperationNames[$operationName], $node->getName()] |
||
| 36 | ) |
||
| 37 | ); |
||
| 38 | } else { |
||
| 39 | $this->knownOperationNames[$operationName] = $node->getName(); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | return $node; |
||
| 45 | } |
||
| 47 |