| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | protected function enterVariableDefinition(VariableDefinitionNode $node): VisitorResult |
||
| 38 | { |
||
| 39 | $variable = $node->getVariable(); |
||
| 40 | $variableName = $variable->getNameValue(); |
||
| 41 | |||
| 42 | if (isset($this->knownVariableNames[$variableName])) { |
||
| 43 | $this->context->reportError( |
||
| 44 | new ValidationException( |
||
| 45 | duplicateVariableMessage($variableName), |
||
|
|
|||
| 46 | [$this->knownVariableNames[$variableName], $variable->getName()] |
||
| 47 | ) |
||
| 48 | ); |
||
| 49 | } else { |
||
| 50 | $this->knownVariableNames[$variableName] = $variable->getName(); |
||
| 51 | } |
||
| 52 | |||
| 53 | return new VisitorResult($node); |
||
| 54 | } |
||
| 56 |