@@ -18,24 +18,24 @@ discard block |
||
| 18 | 18 | { |
| 19 | 19 | public static function resolve( |
| 20 | 20 | string $alias, |
| 21 | - \Stringable|string|null $context = null, |
|
| 21 | + \Stringable | string | null $context = null, |
|
| 22 | 22 | ?ContainerInterface $c = null, |
| 23 | 23 | ): object { |
| 24 | 24 | $c ??= ContainerScope::getContainer() ?? throw new ContainerException('Proxy is out of scope.'); |
| 25 | 25 | |
| 26 | - try { |
|
| 26 | + try{ |
|
| 27 | 27 | /** @psalm-suppress TooManyArguments */ |
| 28 | 28 | $result = $c->get($alias, $context) ?? throw new ContainerException( |
| 29 | 29 | 'Resolved `null` from the container.', |
| 30 | 30 | ); |
| 31 | - } catch (\Throwable $e) { |
|
| 31 | + }catch (\Throwable $e){ |
|
| 32 | 32 | throw new ContainerException( |
| 33 | 33 | \sprintf('Unable to resolve `%s` in a Proxy in `%s` scope.', $alias, self::getScope($c)), |
| 34 | 34 | previous: $e, |
| 35 | 35 | ); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - if (Proxy::isProxy($result)) { |
|
| 38 | + if (Proxy::isProxy($result)){ |
|
| 39 | 39 | throw new RecursiveProxyException( |
| 40 | 40 | \sprintf('Recursive proxy detected for `%s` in `%s` scope.', $alias, self::getScope($c)), |
| 41 | 41 | ); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | private static function getScope(ContainerInterface $c): string |
| 51 | 51 | { |
| 52 | 52 | return \implode('.', \array_reverse(\array_map( |
| 53 | - static fn(?string $name): string => $name ?? 'null', |
|
| 53 | + static fn(?string $name) : string => $name ?? 'null', |
|
| 54 | 54 | Introspector::scopeNames($c), |
| 55 | 55 | ))); |
| 56 | 56 | } |
@@ -23,19 +23,23 @@ |
||
| 23 | 23 | ): object { |
| 24 | 24 | $c ??= ContainerScope::getContainer() ?? throw new ContainerException('Proxy is out of scope.'); |
| 25 | 25 | |
| 26 | - try { |
|
| 26 | + try |
|
| 27 | + { |
|
| 27 | 28 | /** @psalm-suppress TooManyArguments */ |
| 28 | 29 | $result = $c->get($alias, $context) ?? throw new ContainerException( |
| 29 | 30 | 'Resolved `null` from the container.', |
| 30 | 31 | ); |
| 31 | - } catch (\Throwable $e) { |
|
| 32 | + } |
|
| 33 | + catch (\Throwable $e) |
|
| 34 | + { |
|
| 32 | 35 | throw new ContainerException( |
| 33 | 36 | \sprintf('Unable to resolve `%s` in a Proxy in `%s` scope.', $alias, self::getScope($c)), |
| 34 | 37 | previous: $e, |
| 35 | 38 | ); |
| 36 | 39 | } |
| 37 | 40 | |
| 38 | - if (Proxy::isProxy($result)) { |
|
| 41 | + if (Proxy::isProxy($result)) |
|
| 42 | + { |
|
| 39 | 43 | throw new RecursiveProxyException( |
| 40 | 44 | \sprintf('Recursive proxy detected for `%s` in `%s` scope.', $alias, self::getScope($c)), |
| 41 | 45 | ); |