| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public static function resolve(string $alias): object |
||
| 16 | { |
||
| 17 | $c = ContainerScope::getContainer() ?? throw new ContainerException('Proxy is out of scope.'); |
||
| 18 | |||
| 19 | try { |
||
| 20 | $result = $c->get($alias) ?? throw new ContainerException( |
||
| 21 | 'Resolved `null` from the container.', |
||
| 22 | ); |
||
| 23 | } catch (ContainerException $e) { |
||
| 24 | throw new ContainerException( |
||
| 25 | // todo : find required scope |
||
| 26 | \sprintf('Unable to resolve `%s` in a Proxy.', $alias), |
||
| 27 | previous: $e, |
||
| 28 | ); |
||
| 29 | } |
||
| 30 | |||
| 31 | return $result; |
||
| 32 | } |
||
| 34 |