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