Conditions | 6 |
Paths | 6 |
Total Lines | 28 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | protected function enterField(FieldNode $node): ?NodeInterface |
||
25 | { |
||
26 | $type = $this->context->getType(); |
||
27 | $selectionSet = $node->getSelectionSet(); |
||
28 | |||
29 | if (null !== $type) { |
||
30 | if (getNamedType($type) instanceof LeafTypeInterface) { |
||
31 | if (null !== $selectionSet) { |
||
32 | $this->context->reportError( |
||
33 | new ValidationException( |
||
34 | noSubselectionAllowedMessage((string)$node, (string)$type), |
||
35 | [$selectionSet] |
||
36 | ) |
||
37 | ); |
||
38 | } |
||
39 | } elseif (null === $selectionSet) { |
||
40 | $this->context->reportError( |
||
41 | new ValidationException( |
||
42 | requiresSubselectionMessage((string)$node, (string)$type), |
||
43 | [$node] |
||
44 | ) |
||
45 | ); |
||
46 | } |
||
47 | } |
||
48 | |||
49 | return $node; |
||
50 | } |
||
51 | } |
||
52 |