Conditions | 3 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
40 | protected function enterVariableDefinition(VariableDefinitionNode $node): ?NodeInterface |
||
41 | { |
||
42 | $variable = $node->getVariable(); |
||
43 | $variableName = $variable->getNameValue(); |
||
44 | $defaultValue = $node->getDefaultValue(); |
||
45 | $type = $this->context->getInputType(); |
||
46 | |||
47 | if (null !== $defaultValue && $type instanceof NonNullType) { |
||
48 | $this->context->reportError( |
||
49 | new ValidationException( |
||
50 | variableDefaultValueNotAllowedMessage($variableName, $type, $type->getOfType()), |
||
|
|||
51 | [$defaultValue] |
||
52 | ) |
||
53 | ); |
||
54 | } |
||
55 | |||
56 | return null; // do not traverse further. |
||
57 | } |
||
59 |