@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | public function __construct( |
17 | 17 | private readonly FilesInterface $files, |
18 | 18 | private readonly DirectoriesInterface $dirs, |
19 | - ) {} |
|
19 | + ){} |
|
20 | 20 | |
21 | 21 | public function ensure(OutputInterface $output): void |
22 | 22 | { |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | $runtimeDirectory = $this->dirs->get('runtime'); |
26 | 26 | |
27 | - if (!$this->files->exists($runtimeDirectory)) { |
|
27 | + if (!$this->files->exists($runtimeDirectory)){ |
|
28 | 28 | $this->files->ensureDirectory($runtimeDirectory); |
29 | 29 | $output->writeln('<comment>created</comment>'); |
30 | 30 | return; |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | $output->writeln('<info>exists</info>'); |
33 | 33 | |
34 | 34 | |
35 | - foreach ($this->files->getFiles($runtimeDirectory) as $filename) { |
|
36 | - try { |
|
35 | + foreach ($this->files->getFiles($runtimeDirectory) as $filename){ |
|
36 | + try{ |
|
37 | 37 | $this->files->setPermissions($filename, FilesInterface::RUNTIME); |
38 | 38 | $this->files->setPermissions(\dirname($filename), FilesInterface::RUNTIME); |
39 | - } catch (\Throwable $e) { |
|
39 | + }catch (\Throwable $e){ |
|
40 | 40 | // @codeCoverageIgnoreStart |
41 | 41 | $output->writeln( |
42 | 42 | \sprintf( |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | // @codeCoverageIgnoreEnd |
50 | 50 | } |
51 | 51 | |
52 | - if ($output->isVerbose()) { |
|
52 | + if ($output->isVerbose()){ |
|
53 | 53 | $output->writeln( |
54 | 54 | \sprintf( |
55 | 55 | '<fg=green>[updated]</fg=green> `%s`', |
@@ -16,7 +16,8 @@ discard block |
||
16 | 16 | public function __construct( |
17 | 17 | private readonly FilesInterface $files, |
18 | 18 | private readonly DirectoriesInterface $dirs, |
19 | - ) {} |
|
19 | + ) { |
|
20 | +} |
|
20 | 21 | |
21 | 22 | public function ensure(OutputInterface $output): void |
22 | 23 | { |
@@ -24,7 +25,8 @@ discard block |
||
24 | 25 | |
25 | 26 | $runtimeDirectory = $this->dirs->get('runtime'); |
26 | 27 | |
27 | - if (!$this->files->exists($runtimeDirectory)) { |
|
28 | + if (!$this->files->exists($runtimeDirectory)) |
|
29 | + { |
|
28 | 30 | $this->files->ensureDirectory($runtimeDirectory); |
29 | 31 | $output->writeln('<comment>created</comment>'); |
30 | 32 | return; |
@@ -32,11 +34,15 @@ discard block |
||
32 | 34 | $output->writeln('<info>exists</info>'); |
33 | 35 | |
34 | 36 | |
35 | - foreach ($this->files->getFiles($runtimeDirectory) as $filename) { |
|
36 | - try { |
|
37 | + foreach ($this->files->getFiles($runtimeDirectory) as $filename) |
|
38 | + { |
|
39 | + try |
|
40 | + { |
|
37 | 41 | $this->files->setPermissions($filename, FilesInterface::RUNTIME); |
38 | 42 | $this->files->setPermissions(\dirname($filename), FilesInterface::RUNTIME); |
39 | - } catch (\Throwable $e) { |
|
43 | + } |
|
44 | + catch (\Throwable $e) |
|
45 | + { |
|
40 | 46 | // @codeCoverageIgnoreStart |
41 | 47 | $output->writeln( |
42 | 48 | \sprintf( |
@@ -49,7 +55,8 @@ discard block |
||
49 | 55 | // @codeCoverageIgnoreEnd |
50 | 56 | } |
51 | 57 | |
52 | - if ($output->isVerbose()) { |
|
58 | + if ($output->isVerbose()) |
|
59 | + { |
|
53 | 60 | $output->writeln( |
54 | 61 | \sprintf( |
55 | 62 | '<fg=green>[updated]</fg=green> `%s`', |
@@ -11,6 +11,6 @@ |
||
11 | 11 | final class DispatcherScope |
12 | 12 | { |
13 | 13 | public function __construct( |
14 | - public readonly string|\BackedEnum $scope, |
|
15 | - ) {} |
|
14 | + public readonly string | \BackedEnum $scope, |
|
15 | + ){} |
|
16 | 16 | } |
@@ -12,5 +12,6 @@ |
||
12 | 12 | { |
13 | 13 | public function __construct( |
14 | 14 | public readonly string|\BackedEnum $scope, |
15 | - ) {} |
|
15 | + ) { |
|
16 | +} |
|
16 | 17 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public function __construct( |
27 | 27 | private readonly ReaderInterface $reader, |
28 | 28 | private readonly ?string $namespace = null, |
29 | - ) {} |
|
29 | + ){} |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Get method RBAC permission if any. Automatically merges with controller namespace. |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | public function getPermission(string $controller, string $action): Permission |
35 | 35 | { |
36 | 36 | $key = \sprintf('%s:%s', $controller, $action); |
37 | - if (!\array_key_exists($key, $this->cache)) { |
|
37 | + if (!\array_key_exists($key, $this->cache)){ |
|
38 | 38 | $this->cache[$key] = $this->generatePermission($controller, $action); |
39 | 39 | } |
40 | 40 | |
@@ -43,20 +43,20 @@ discard block |
||
43 | 43 | |
44 | 44 | private function generatePermission(string $controller, string $action): Permission |
45 | 45 | { |
46 | - try { |
|
46 | + try{ |
|
47 | 47 | $method = new \ReflectionMethod($controller, $action); |
48 | - } catch (\ReflectionException) { |
|
48 | + }catch (\ReflectionException){ |
|
49 | 49 | return Permission::failed(); |
50 | 50 | } |
51 | 51 | |
52 | 52 | $guarded = $this->reader->firstFunctionMetadata($method, Guarded::class); |
53 | - if (!$guarded instanceof Guarded) { |
|
53 | + if (!$guarded instanceof Guarded){ |
|
54 | 54 | return Permission::failed(); |
55 | 55 | } |
56 | 56 | |
57 | 57 | $namespace = $this->reader->firstClassMetadata($method->getDeclaringClass(), GuardNamespace::class); |
58 | 58 | |
59 | - if ($guarded->permission || ($namespace instanceof GuardNamespace && $namespace->namespace)) { |
|
59 | + if ($guarded->permission || ($namespace instanceof GuardNamespace && $namespace->namespace)){ |
|
60 | 60 | return Permission::ok( |
61 | 61 | $this->makePermission($guarded, $method, $namespace), |
62 | 62 | $this->mapFailureException($guarded), |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | private function makePermission(Guarded $guarded, \ReflectionMethod $method, ?GuardNamespace $ns): string |
80 | 80 | { |
81 | 81 | $permission = []; |
82 | - if ($this->namespace) { |
|
82 | + if ($this->namespace){ |
|
83 | 83 | $permission[] = $this->namespace; |
84 | 84 | } |
85 | 85 | |
86 | - if ($ns !== null && $ns->namespace) { |
|
86 | + if ($ns !== null && $ns->namespace){ |
|
87 | 87 | $permission[] = $ns->namespace; |
88 | 88 | } |
89 | 89 |
@@ -26,7 +26,8 @@ discard block |
||
26 | 26 | public function __construct( |
27 | 27 | private readonly ReaderInterface $reader, |
28 | 28 | private readonly ?string $namespace = null, |
29 | - ) {} |
|
29 | + ) { |
|
30 | +} |
|
30 | 31 | |
31 | 32 | /** |
32 | 33 | * Get method RBAC permission if any. Automatically merges with controller namespace. |
@@ -34,7 +35,8 @@ discard block |
||
34 | 35 | public function getPermission(string $controller, string $action): Permission |
35 | 36 | { |
36 | 37 | $key = \sprintf('%s:%s', $controller, $action); |
37 | - if (!\array_key_exists($key, $this->cache)) { |
|
38 | + if (!\array_key_exists($key, $this->cache)) |
|
39 | + { |
|
38 | 40 | $this->cache[$key] = $this->generatePermission($controller, $action); |
39 | 41 | } |
40 | 42 | |
@@ -43,20 +45,25 @@ discard block |
||
43 | 45 | |
44 | 46 | private function generatePermission(string $controller, string $action): Permission |
45 | 47 | { |
46 | - try { |
|
48 | + try |
|
49 | + { |
|
47 | 50 | $method = new \ReflectionMethod($controller, $action); |
48 | - } catch (\ReflectionException) { |
|
51 | + } |
|
52 | + catch (\ReflectionException) |
|
53 | + { |
|
49 | 54 | return Permission::failed(); |
50 | 55 | } |
51 | 56 | |
52 | 57 | $guarded = $this->reader->firstFunctionMetadata($method, Guarded::class); |
53 | - if (!$guarded instanceof Guarded) { |
|
58 | + if (!$guarded instanceof Guarded) |
|
59 | + { |
|
54 | 60 | return Permission::failed(); |
55 | 61 | } |
56 | 62 | |
57 | 63 | $namespace = $this->reader->firstClassMetadata($method->getDeclaringClass(), GuardNamespace::class); |
58 | 64 | |
59 | - if ($guarded->permission || ($namespace instanceof GuardNamespace && $namespace->namespace)) { |
|
65 | + if ($guarded->permission || ($namespace instanceof GuardNamespace && $namespace->namespace)) |
|
66 | + { |
|
60 | 67 | return Permission::ok( |
61 | 68 | $this->makePermission($guarded, $method, $namespace), |
62 | 69 | $this->mapFailureException($guarded), |
@@ -79,11 +86,13 @@ discard block |
||
79 | 86 | private function makePermission(Guarded $guarded, \ReflectionMethod $method, ?GuardNamespace $ns): string |
80 | 87 | { |
81 | 88 | $permission = []; |
82 | - if ($this->namespace) { |
|
89 | + if ($this->namespace) |
|
90 | + { |
|
83 | 91 | $permission[] = $this->namespace; |
84 | 92 | } |
85 | 93 | |
86 | - if ($ns !== null && $ns->namespace) { |
|
94 | + if ($ns !== null && $ns->namespace) |
|
95 | + { |
|
87 | 96 | $permission[] = $ns->namespace; |
88 | 97 | } |
89 | 98 |
@@ -30,5 +30,5 @@ |
||
30 | 30 | /** @Enum({"notFound","unauthorized","forbidden","badAction","error"}) */ |
31 | 31 | public readonly string $else = 'forbidden', |
32 | 32 | public readonly ?string $errorMessage = null, |
33 | - ) {} |
|
33 | + ){} |
|
34 | 34 | } |
@@ -30,5 +30,6 @@ |
||
30 | 30 | /** @Enum({"notFound","unauthorized","forbidden","badAction","error"}) */ |
31 | 31 | public readonly string $else = 'forbidden', |
32 | 32 | public readonly ?string $errorMessage = null, |
33 | - ) {} |
|
33 | + ) { |
|
34 | +} |
|
34 | 35 | } |
@@ -24,5 +24,5 @@ |
||
24 | 24 | public function __construct( |
25 | 25 | public readonly array $pipeline = [], |
26 | 26 | public readonly bool $skipNext = false, |
27 | - ) {} |
|
27 | + ){} |
|
28 | 28 | } |
@@ -24,5 +24,6 @@ |
||
24 | 24 | public function __construct( |
25 | 25 | public readonly array $pipeline = [], |
26 | 26 | public readonly bool $skipNext = false, |
27 | - ) {} |
|
27 | + ) { |
|
28 | +} |
|
28 | 29 | } |
@@ -25,5 +25,5 @@ |
||
25 | 25 | */ |
26 | 26 | public function __construct( |
27 | 27 | public readonly string $namespace, |
28 | - ) {} |
|
28 | + ){} |
|
29 | 29 | } |
@@ -25,5 +25,6 @@ |
||
25 | 25 | */ |
26 | 26 | public function __construct( |
27 | 27 | public readonly string $namespace, |
28 | - ) {} |
|
28 | + ) { |
|
29 | +} |
|
29 | 30 | } |
@@ -18,13 +18,13 @@ |
||
18 | 18 | public function __construct( |
19 | 19 | private readonly GuardInterface $guard, |
20 | 20 | private readonly PermissionsProviderInterface $permissions, |
21 | - ) {} |
|
21 | + ){} |
|
22 | 22 | |
23 | 23 | public function process(string $controller, string $action, array $parameters, CoreInterface $core): mixed |
24 | 24 | { |
25 | 25 | $permission = $this->permissions->getPermission($controller, $action); |
26 | 26 | |
27 | - if ($permission->ok && !$this->guard->allows($permission->permission, $parameters)) { |
|
27 | + if ($permission->ok && !$this->guard->allows($permission->permission, $parameters)){ |
|
28 | 28 | throw new ControllerException($permission->message, $permission->code); |
29 | 29 | } |
30 | 30 |
@@ -18,13 +18,15 @@ |
||
18 | 18 | public function __construct( |
19 | 19 | private readonly GuardInterface $guard, |
20 | 20 | private readonly PermissionsProviderInterface $permissions, |
21 | - ) {} |
|
21 | + ) { |
|
22 | +} |
|
22 | 23 | |
23 | 24 | public function process(string $controller, string $action, array $parameters, CoreInterface $core): mixed |
24 | 25 | { |
25 | 26 | $permission = $this->permissions->getPermission($controller, $action); |
26 | 27 | |
27 | - if ($permission->ok && !$this->guard->allows($permission->permission, $parameters)) { |
|
28 | + if ($permission->ok && !$this->guard->allows($permission->permission, $parameters)) |
|
29 | + { |
|
28 | 30 | throw new ControllerException($permission->message, $permission->code); |
29 | 31 | } |
30 | 32 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | private ReaderInterface $reader, |
25 | 25 | private ContainerInterface $container, |
26 | 26 | private ?EventDispatcherInterface $dispatcher = null, |
27 | - ) {} |
|
27 | + ){} |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @throws \Throwable |
@@ -32,17 +32,17 @@ discard block |
||
32 | 32 | public function process(string $controller, string $action, array $parameters, CoreInterface $core): mixed |
33 | 33 | { |
34 | 34 | $annotation = $this->readAnnotation($controller, $action); |
35 | - if ($core instanceof InterceptorPipeline && $annotation->skipNext) { |
|
35 | + if ($core instanceof InterceptorPipeline && $annotation->skipNext){ |
|
36 | 36 | $this->removeNextInterceptorsFromOriginalPipeline($core); |
37 | 37 | } |
38 | 38 | |
39 | 39 | $pipeline = $this->getCachedPipeline($controller, $action, $annotation); |
40 | - if (!empty($pipeline)) { |
|
41 | - if ($core instanceof InterceptorPipeline) { |
|
40 | + if (!empty($pipeline)){ |
|
41 | + if ($core instanceof InterceptorPipeline){ |
|
42 | 42 | $this->injectInterceptorsIntoOriginalPipeline($core, $pipeline); |
43 | - } else { |
|
43 | + }else{ |
|
44 | 44 | $core = new InterceptableCore($core, $this->dispatcher); |
45 | - foreach ($pipeline as $interceptor) { |
|
45 | + foreach ($pipeline as $interceptor){ |
|
46 | 46 | $core->addInterceptor($interceptor); |
47 | 47 | } |
48 | 48 | } |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | |
54 | 54 | private function readAnnotation(string $controller, string $action): Pipeline |
55 | 55 | { |
56 | - try { |
|
56 | + try{ |
|
57 | 57 | $method = new \ReflectionMethod($controller, $action); |
58 | - } catch (\ReflectionException) { |
|
58 | + }catch (\ReflectionException){ |
|
59 | 59 | return new Pipeline(); |
60 | 60 | } |
61 | 61 | |
@@ -70,14 +70,14 @@ discard block |
||
70 | 70 | |
71 | 71 | $oldInterceptors = $pipelineReflection->getValue($pipeline); |
72 | 72 | $newInterceptors = []; |
73 | - foreach ($oldInterceptors as $interceptor) { |
|
73 | + foreach ($oldInterceptors as $interceptor){ |
|
74 | 74 | $newInterceptors[] = $interceptor; |
75 | - if ($interceptor instanceof self) { |
|
75 | + if ($interceptor instanceof self){ |
|
76 | 76 | break; |
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
80 | - if (\count($newInterceptors) !== \count($oldInterceptors)) { |
|
80 | + if (\count($newInterceptors) !== \count($oldInterceptors)){ |
|
81 | 81 | $pipelineReflection->setValue($pipeline, $newInterceptors); |
82 | 82 | } |
83 | 83 | } |
@@ -88,16 +88,16 @@ discard block |
||
88 | 88 | |
89 | 89 | $oldInterceptors = $pipelineReflection->getValue($pipeline); |
90 | 90 | $newInterceptors = []; |
91 | - foreach ($oldInterceptors as $interceptor) { |
|
91 | + foreach ($oldInterceptors as $interceptor){ |
|
92 | 92 | $newInterceptors[] = $interceptor; |
93 | - if ($interceptor instanceof self) { |
|
94 | - foreach ($interceptors as $newInterceptor) { |
|
93 | + if ($interceptor instanceof self){ |
|
94 | + foreach ($interceptors as $newInterceptor){ |
|
95 | 95 | $newInterceptors[] = $newInterceptor; |
96 | 96 | } |
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
100 | - if (\count($newInterceptors) !== \count($oldInterceptors)) { |
|
100 | + if (\count($newInterceptors) !== \count($oldInterceptors)){ |
|
101 | 101 | $pipelineReflection->setValue($pipeline, $newInterceptors); |
102 | 102 | } |
103 | 103 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | private function getCachedPipeline(string $controller, string $action, Pipeline $annotation): array |
106 | 106 | { |
107 | 107 | $key = "{$controller}:{$action}"; |
108 | - if (!\array_key_exists($key, $this->cache)) { |
|
108 | + if (!\array_key_exists($key, $this->cache)){ |
|
109 | 109 | $this->cache[$key] = $this->extractAnnotationPipeline($annotation); |
110 | 110 | } |
111 | 111 | |
@@ -115,10 +115,10 @@ discard block |
||
115 | 115 | private function extractAnnotationPipeline(Pipeline $annotation): array |
116 | 116 | { |
117 | 117 | $interceptors = []; |
118 | - foreach ($annotation->pipeline as $interceptor) { |
|
119 | - try { |
|
118 | + foreach ($annotation->pipeline as $interceptor){ |
|
119 | + try{ |
|
120 | 120 | $interceptors[] = $this->container->get($interceptor); |
121 | - } catch (\Throwable) { |
|
121 | + }catch (\Throwable){ |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 |
@@ -24,7 +24,8 @@ discard block |
||
24 | 24 | private ReaderInterface $reader, |
25 | 25 | private ContainerInterface $container, |
26 | 26 | private ?EventDispatcherInterface $dispatcher = null, |
27 | - ) {} |
|
27 | + ) { |
|
28 | +} |
|
28 | 29 | |
29 | 30 | /** |
30 | 31 | * @throws \Throwable |
@@ -32,17 +33,23 @@ discard block |
||
32 | 33 | public function process(string $controller, string $action, array $parameters, CoreInterface $core): mixed |
33 | 34 | { |
34 | 35 | $annotation = $this->readAnnotation($controller, $action); |
35 | - if ($core instanceof InterceptorPipeline && $annotation->skipNext) { |
|
36 | + if ($core instanceof InterceptorPipeline && $annotation->skipNext) |
|
37 | + { |
|
36 | 38 | $this->removeNextInterceptorsFromOriginalPipeline($core); |
37 | 39 | } |
38 | 40 | |
39 | 41 | $pipeline = $this->getCachedPipeline($controller, $action, $annotation); |
40 | - if (!empty($pipeline)) { |
|
41 | - if ($core instanceof InterceptorPipeline) { |
|
42 | + if (!empty($pipeline)) |
|
43 | + { |
|
44 | + if ($core instanceof InterceptorPipeline) |
|
45 | + { |
|
42 | 46 | $this->injectInterceptorsIntoOriginalPipeline($core, $pipeline); |
43 | - } else { |
|
47 | + } |
|
48 | + else |
|
49 | + { |
|
44 | 50 | $core = new InterceptableCore($core, $this->dispatcher); |
45 | - foreach ($pipeline as $interceptor) { |
|
51 | + foreach ($pipeline as $interceptor) |
|
52 | + { |
|
46 | 53 | $core->addInterceptor($interceptor); |
47 | 54 | } |
48 | 55 | } |
@@ -53,9 +60,12 @@ discard block |
||
53 | 60 | |
54 | 61 | private function readAnnotation(string $controller, string $action): Pipeline |
55 | 62 | { |
56 | - try { |
|
63 | + try |
|
64 | + { |
|
57 | 65 | $method = new \ReflectionMethod($controller, $action); |
58 | - } catch (\ReflectionException) { |
|
66 | + } |
|
67 | + catch (\ReflectionException) |
|
68 | + { |
|
59 | 69 | return new Pipeline(); |
60 | 70 | } |
61 | 71 | |
@@ -70,14 +80,17 @@ discard block |
||
70 | 80 | |
71 | 81 | $oldInterceptors = $pipelineReflection->getValue($pipeline); |
72 | 82 | $newInterceptors = []; |
73 | - foreach ($oldInterceptors as $interceptor) { |
|
83 | + foreach ($oldInterceptors as $interceptor) |
|
84 | + { |
|
74 | 85 | $newInterceptors[] = $interceptor; |
75 | - if ($interceptor instanceof self) { |
|
86 | + if ($interceptor instanceof self) |
|
87 | + { |
|
76 | 88 | break; |
77 | 89 | } |
78 | 90 | } |
79 | 91 | |
80 | - if (\count($newInterceptors) !== \count($oldInterceptors)) { |
|
92 | + if (\count($newInterceptors) !== \count($oldInterceptors)) |
|
93 | + { |
|
81 | 94 | $pipelineReflection->setValue($pipeline, $newInterceptors); |
82 | 95 | } |
83 | 96 | } |
@@ -88,16 +101,20 @@ discard block |
||
88 | 101 | |
89 | 102 | $oldInterceptors = $pipelineReflection->getValue($pipeline); |
90 | 103 | $newInterceptors = []; |
91 | - foreach ($oldInterceptors as $interceptor) { |
|
104 | + foreach ($oldInterceptors as $interceptor) |
|
105 | + { |
|
92 | 106 | $newInterceptors[] = $interceptor; |
93 | - if ($interceptor instanceof self) { |
|
94 | - foreach ($interceptors as $newInterceptor) { |
|
107 | + if ($interceptor instanceof self) |
|
108 | + { |
|
109 | + foreach ($interceptors as $newInterceptor) |
|
110 | + { |
|
95 | 111 | $newInterceptors[] = $newInterceptor; |
96 | 112 | } |
97 | 113 | } |
98 | 114 | } |
99 | 115 | |
100 | - if (\count($newInterceptors) !== \count($oldInterceptors)) { |
|
116 | + if (\count($newInterceptors) !== \count($oldInterceptors)) |
|
117 | + { |
|
101 | 118 | $pipelineReflection->setValue($pipeline, $newInterceptors); |
102 | 119 | } |
103 | 120 | } |
@@ -105,7 +122,8 @@ discard block |
||
105 | 122 | private function getCachedPipeline(string $controller, string $action, Pipeline $annotation): array |
106 | 123 | { |
107 | 124 | $key = "{$controller}:{$action}"; |
108 | - if (!\array_key_exists($key, $this->cache)) { |
|
125 | + if (!\array_key_exists($key, $this->cache)) |
|
126 | + { |
|
109 | 127 | $this->cache[$key] = $this->extractAnnotationPipeline($annotation); |
110 | 128 | } |
111 | 129 | |
@@ -115,10 +133,14 @@ discard block |
||
115 | 133 | private function extractAnnotationPipeline(Pipeline $annotation): array |
116 | 134 | { |
117 | 135 | $interceptors = []; |
118 | - foreach ($annotation->pipeline as $interceptor) { |
|
119 | - try { |
|
136 | + foreach ($annotation->pipeline as $interceptor) |
|
137 | + { |
|
138 | + try |
|
139 | + { |
|
120 | 140 | $interceptors[] = $this->container->get($interceptor); |
121 | - } catch (\Throwable) { |
|
141 | + } |
|
142 | + catch (\Throwable) |
|
143 | + { |
|
122 | 144 | } |
123 | 145 | } |
124 | 146 |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public int $code; |
12 | 12 | public string $message; |
13 | 13 | |
14 | - protected function __construct() {} |
|
14 | + protected function __construct(){} |
|
15 | 15 | |
16 | 16 | public static function failed(): self |
17 | 17 | { |
@@ -11,7 +11,9 @@ |
||
11 | 11 | public int $code; |
12 | 12 | public string $message; |
13 | 13 | |
14 | - protected function __construct() {} |
|
14 | + protected function __construct() |
|
15 | + { |
|
16 | +} |
|
15 | 17 | |
16 | 18 | public static function failed(): self |
17 | 19 | { |