@@ -22,19 +22,23 @@ |
||
| 22 | 22 | ): object { |
| 23 | 23 | $c ??= ContainerScope::getContainer() ?? throw new ContainerException('Proxy is out of scope.'); |
| 24 | 24 | |
| 25 | - try { |
|
| 25 | + try |
|
| 26 | + { |
|
| 26 | 27 | /** @psalm-suppress TooManyArguments */ |
| 27 | 28 | $result = $c->get($alias, $context) ?? throw new ContainerException( |
| 28 | 29 | 'Resolved `null` from the container.', |
| 29 | 30 | ); |
| 30 | - } catch (\Throwable $e) { |
|
| 31 | + } |
|
| 32 | + catch (\Throwable $e) |
|
| 33 | + { |
|
| 31 | 34 | throw new ContainerException( |
| 32 | 35 | \sprintf('Unable to resolve `%s` in a Proxy.', $alias), |
| 33 | 36 | previous: $e, |
| 34 | 37 | ); |
| 35 | 38 | } |
| 36 | 39 | |
| 37 | - if (Proxy::isProxy($result)) { |
|
| 40 | + if (Proxy::isProxy($result)) |
|
| 41 | + { |
|
| 38 | 42 | throw new RecursiveProxyException( |
| 39 | 43 | \sprintf('Recursive proxy detected for `%s`.', $alias), |
| 40 | 44 | ); |