| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function execute(ContainerInterface $app) |
||
| 24 | { |
||
| 25 | try { |
||
| 26 | $app->inject($this->test); |
||
| 27 | } catch (CannotInjectException $exception) { |
||
| 28 | $propertyName = $exception->getProperty(); |
||
| 29 | $className = $exception->getClass(); |
||
| 30 | if (class_exists($className)) { |
||
| 31 | $app->inject($this->test, [ |
||
| 32 | $propertyName => $app->create($className) |
||
| 33 | ]); |
||
| 34 | } else { |
||
| 35 | throw $exception; |
||
| 36 | } |
||
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 45 |