@@ -7,4 +7,4 @@ |
||
7 | 7 | /** |
8 | 8 | * Configuration specific exceptions. |
9 | 9 | */ |
10 | -class ConfiguratorException extends LogicException {} |
|
10 | +class ConfiguratorException extends LogicException{} |
@@ -7,4 +7,6 @@ |
||
7 | 7 | /** |
8 | 8 | * Configuration specific exceptions. |
9 | 9 | */ |
10 | -class ConfiguratorException extends LogicException {} |
|
10 | +class ConfiguratorException extends LogicException |
|
11 | +{ |
|
12 | +} |
@@ -17,10 +17,10 @@ |
||
17 | 17 | |
18 | 18 | public function __construct( |
19 | 19 | protected readonly string $id, |
20 | - Container|string|null $scopeOrContainer = null, |
|
20 | + Container | string | null $scopeOrContainer = null, |
|
21 | 21 | protected readonly ?string $requiredScope = null, |
22 | - \Throwable|null $previous = null, |
|
23 | - ) { |
|
22 | + \Throwable | null $previous = null, |
|
23 | + ){ |
|
24 | 24 | $this->scope = \is_string($scopeOrContainer) |
25 | 25 | ? $scopeOrContainer |
26 | 26 | : Introspector::scopeName($scopeOrContainer); |
@@ -7,4 +7,4 @@ |
||
7 | 7 | /** |
8 | 8 | * Raised when non allowed operations applied to configuration data. |
9 | 9 | */ |
10 | -class ConfigException extends RuntimeException {} |
|
10 | +class ConfigException extends RuntimeException{} |
@@ -7,4 +7,6 @@ |
||
7 | 7 | /** |
8 | 8 | * Raised when non allowed operations applied to configuration data. |
9 | 9 | */ |
10 | -class ConfigException extends RuntimeException {} |
|
10 | +class ConfigException extends RuntimeException |
|
11 | +{ |
|
12 | +} |
@@ -33,26 +33,26 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public static function runScope(ContainerInterface $container, callable $scope): mixed |
35 | 35 | { |
36 | - if (Proxy::isProxy($container)) { |
|
36 | + if (Proxy::isProxy($container)){ |
|
37 | 37 | // Ignore Proxy to avoid recursion |
38 | 38 | $container = $previous = self::$container ?? throw new ContainerException('Proxy is out of scope.'); |
39 | - } else { |
|
39 | + }else{ |
|
40 | 40 | [$previous, self::$container] = [self::$container, $container]; |
41 | 41 | } |
42 | 42 | |
43 | - try { |
|
44 | - if (\Fiber::getCurrent() === null) { |
|
43 | + try{ |
|
44 | + if (\Fiber::getCurrent() === null){ |
|
45 | 45 | return $scope(self::$container); |
46 | 46 | } |
47 | 47 | |
48 | 48 | // Wrap scope into fiber |
49 | 49 | $fiber = new \Fiber(static fn() => $scope(self::$container)); |
50 | 50 | $value = $fiber->start(); |
51 | - while (!$fiber->isTerminated()) { |
|
51 | + while (!$fiber->isTerminated()){ |
|
52 | 52 | self::$container = $previous; |
53 | - try { |
|
53 | + try{ |
|
54 | 54 | $resume = \Fiber::suspend($value); |
55 | - } catch (\Throwable $e) { |
|
55 | + }catch (\Throwable $e){ |
|
56 | 56 | self::$container = $container; |
57 | 57 | $value = $fiber->throw($e); |
58 | 58 | continue; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $value = $fiber->resume($resume); |
63 | 63 | } |
64 | 64 | return $fiber->getReturn(); |
65 | - } finally { |
|
65 | + }finally{ |
|
66 | 66 | self::$container = $previous; |
67 | 67 | } |
68 | 68 | } |
@@ -33,26 +33,35 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public static function runScope(ContainerInterface $container, callable $scope): mixed |
35 | 35 | { |
36 | - if (Proxy::isProxy($container)) { |
|
36 | + if (Proxy::isProxy($container)) |
|
37 | + { |
|
37 | 38 | // Ignore Proxy to avoid recursion |
38 | 39 | $container = $previous = self::$container ?? throw new ContainerException('Proxy is out of scope.'); |
39 | - } else { |
|
40 | + } |
|
41 | + else |
|
42 | + { |
|
40 | 43 | [$previous, self::$container] = [self::$container, $container]; |
41 | 44 | } |
42 | 45 | |
43 | - try { |
|
44 | - if (\Fiber::getCurrent() === null) { |
|
46 | + try |
|
47 | + { |
|
48 | + if (\Fiber::getCurrent() === null) |
|
49 | + { |
|
45 | 50 | return $scope(self::$container); |
46 | 51 | } |
47 | 52 | |
48 | 53 | // Wrap scope into fiber |
49 | 54 | $fiber = new \Fiber(static fn() => $scope(self::$container)); |
50 | 55 | $value = $fiber->start(); |
51 | - while (!$fiber->isTerminated()) { |
|
56 | + while (!$fiber->isTerminated()) |
|
57 | + { |
|
52 | 58 | self::$container = $previous; |
53 | - try { |
|
59 | + try |
|
60 | + { |
|
54 | 61 | $resume = \Fiber::suspend($value); |
55 | - } catch (\Throwable $e) { |
|
62 | + } |
|
63 | + catch (\Throwable $e) |
|
64 | + { |
|
56 | 65 | self::$container = $container; |
57 | 66 | $value = $fiber->throw($e); |
58 | 67 | continue; |
@@ -62,7 +71,9 @@ discard block |
||
62 | 71 | $value = $fiber->resume($resume); |
63 | 72 | } |
64 | 73 | return $fiber->getReturn(); |
65 | - } finally { |
|
74 | + } |
|
75 | + finally |
|
76 | + { |
|
66 | 77 | self::$container = $previous; |
67 | 78 | } |
68 | 79 | } |
@@ -7,4 +7,4 @@ |
||
7 | 7 | /** |
8 | 8 | * @internal |
9 | 9 | */ |
10 | -interface Plugin {} |
|
10 | +interface Plugin{} |
@@ -7,4 +7,6 @@ |
||
7 | 7 | /** |
8 | 8 | * @internal |
9 | 9 | */ |
10 | -interface Plugin {} |
|
10 | +interface Plugin |
|
11 | +{ |
|
12 | +} |
@@ -14,5 +14,5 @@ |
||
14 | 14 | { |
15 | 15 | public function __construct( |
16 | 16 | public string $method, |
17 | - ) {} |
|
17 | + ){} |
|
18 | 18 | } |
@@ -14,5 +14,6 @@ |
||
14 | 14 | { |
15 | 15 | public function __construct( |
16 | 16 | public string $method, |
17 | - ) {} |
|
17 | + ) { |
|
18 | +} |
|
18 | 19 | } |
@@ -8,4 +8,4 @@ |
||
8 | 8 | * Mark class as singleton. |
9 | 9 | */ |
10 | 10 | #[\Attribute(\Attribute::TARGET_CLASS)] |
11 | -final class Singleton implements Plugin {} |
|
11 | +final class Singleton implements Plugin{} |
@@ -8,4 +8,6 @@ |
||
8 | 8 | * Mark class as singleton. |
9 | 9 | */ |
10 | 10 | #[\Attribute(\Attribute::TARGET_CLASS)] |
11 | -final class Singleton implements Plugin {} |
|
11 | +final class Singleton implements Plugin |
|
12 | +{ |
|
13 | +} |
@@ -16,7 +16,7 @@ |
||
16 | 16 | public function __construct( |
17 | 17 | private readonly ClassesInterface $classes, |
18 | 18 | private readonly ScopedClassesInterface $scopedClasses, |
19 | - ) {} |
|
19 | + ){} |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @return class-string[] |
@@ -16,7 +16,8 @@ |
||
16 | 16 | public function __construct( |
17 | 17 | private readonly ClassesInterface $classes, |
18 | 18 | private readonly ScopedClassesInterface $scopedClasses, |
19 | - ) {} |
|
19 | + ) { |
|
20 | +} |
|
20 | 21 | |
21 | 22 | /** |
22 | 23 | * @return class-string[] |
@@ -16,7 +16,7 @@ |
||
16 | 16 | public function __construct( |
17 | 17 | private readonly InterfacesInterface $interfaces, |
18 | 18 | private readonly ScopedInterfacesInterface $scopedInterfaces, |
19 | - ) {} |
|
19 | + ){} |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @return class-string[] |
@@ -16,7 +16,8 @@ |
||
16 | 16 | public function __construct( |
17 | 17 | private readonly InterfacesInterface $interfaces, |
18 | 18 | private readonly ScopedInterfacesInterface $scopedInterfaces, |
19 | - ) {} |
|
19 | + ) { |
|
20 | +} |
|
20 | 21 | |
21 | 22 | /** |
22 | 23 | * @return class-string[] |