| Conditions | 5 |
| Paths | 6 |
| Total Lines | 24 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function enterNode(NodeInterface $node): ?NodeInterface |
||
| 29 | { |
||
| 30 | if ($node instanceof FieldNode || $node instanceof DirectiveNode) { |
||
| 31 | $this->knownArgumentNames = []; |
||
| 32 | } |
||
| 33 | |||
| 34 | if ($node instanceof ArgumentNode) { |
||
| 35 | $argumentName = $node->getNameValue(); |
||
| 36 | |||
| 37 | if (isset($this->knownArgumentNames[$argumentName])) { |
||
| 38 | $this->validationContext->reportError( |
||
| 39 | new ValidationException( |
||
| 40 | duplicateArgumentMessage($argumentName), |
||
| 41 | [$this->knownArgumentNames[$argumentName], $node->getName()] |
||
| 42 | ) |
||
| 43 | ); |
||
| 44 | } else { |
||
| 45 | $this->knownArgumentNames[$argumentName] = $node->getName(); |
||
| 46 | } |
||
| 47 | |||
| 48 | return null; |
||
| 49 | } |
||
| 50 | |||
| 51 | return $node; |
||
| 52 | } |
||
| 54 |