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