| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function __invoke(string $varName, array $query, InjectorInterface $injector) |
||
| 33 | { |
||
| 34 | try { |
||
| 35 | $props = $this->getProps($varName, $query, $injector); |
||
| 36 | } catch (ParameterException $e) { |
||
| 37 | if ($this->parameter->isDefaultValueAvailable()) { |
||
| 38 | return $this->parameter->getDefaultValue(); |
||
| 39 | } |
||
| 40 | |||
| 41 | throw $e; |
||
| 42 | } |
||
| 43 | $obj = $this->class->newInstanceWithoutConstructor(); |
||
| 44 | foreach ($props as $propName => $propValue) { |
||
| 45 | $obj->{$propName} = $propValue; |
||
| 46 | } |
||
| 47 | |||
| 48 | return $obj; |
||
| 49 | } |
||
| 50 | |||
| 67 |