Conditions | 3 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | #[Override] |
||
30 | public function __invoke(string $varName, array $query, InjectorInterface $injector) |
||
31 | { |
||
32 | $type = $this->parameter->getType(); |
||
33 | if ($type instanceof ReflectionNamedType && ! $type->isBuiltin()) { |
||
34 | $inputClass = $type->getName(); |
||
35 | assert(class_exists($inputClass)); |
||
36 | |||
37 | return $this->inputQuery->create($inputClass, $query); |
||
38 | } |
||
39 | |||
40 | // For built-in types, return from query directly |
||
41 | return $query[$varName] ?? null; |
||
42 | } |
||
44 |