| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function enterNode(NodeInterface $node): ?NodeInterface |
||
| 25 | { |
||
| 26 | if ($node instanceof VariableDefinitionNode) { |
||
| 27 | $type = typeFromAST($this->validationContext->getSchema(), $node->getType()); |
||
| 28 | |||
| 29 | if (!isInputType($type)) { |
||
| 30 | $variableName = $node->getVariable()->getNameValue(); |
||
| 31 | |||
| 32 | $this->validationContext->reportError( |
||
| 33 | new ValidationException( |
||
| 34 | nonInputTypeOnVariableMessage($variableName, printNode($node->getType())), |
||
| 35 | [$node->getType()] |
||
| 36 | ) |
||
| 37 | ); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | return $node; |
||
| 42 | } |
||
| 44 |