| Conditions | 4 |
| Paths | 6 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function enterNode(NodeInterface $node): ?NodeInterface |
||
| 33 | { |
||
| 34 | if ($node instanceof ObjectValueNode) { |
||
| 35 | $this->knownInputNamesStack[] = $this->knownInputNames; |
||
| 36 | $this->knownInputNames = []; |
||
| 37 | } |
||
| 38 | |||
| 39 | if ($node instanceof ObjectFieldNode) { |
||
| 40 | $fieldName = $node->getNameValue(); |
||
| 41 | |||
| 42 | if (isset($this->knownInputNames[$fieldName])) { |
||
| 43 | $this->validationContext->reportError( |
||
| 44 | new ValidationException( |
||
| 45 | duplicateInputFieldMessage($fieldName), |
||
| 46 | [$this->knownInputNames[$fieldName], $node->getName()] |
||
| 47 | ) |
||
| 48 | ); |
||
| 49 | } else { |
||
| 50 | $this->knownInputNames[$fieldName] = $node->getName(); |
||
| 51 | } |
||
| 52 | } |
||
| 53 | |||
| 54 | return $node; |
||
| 55 | } |
||
| 71 |