@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | { |
19 | 19 | public function __construct( |
20 | 20 | private InputManager $input, |
21 | - ) {} |
|
21 | + ){} |
|
22 | 22 | |
23 | 23 | public function withPrefix(string $prefix, bool $add = true): InputInterface |
24 | 24 | { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | public function getValue(string $source, mixed $name = null): mixed |
32 | 32 | { |
33 | - if (!$this->input->hasBag($source) && !\method_exists($this->input, $source)) { |
|
33 | + if (!$this->input->hasBag($source) && !\method_exists($this->input, $source)){ |
|
34 | 34 | throw new InputException(\sprintf('Undefined input source %s', $source)); |
35 | 35 | } |
36 | 36 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | public function hasValue(string $source, string $name): bool |
41 | 41 | { |
42 | - if (!$this->input->hasBag($source)) { |
|
42 | + if (!$this->input->hasBag($source)){ |
|
43 | 43 | return false; |
44 | 44 | } |
45 | 45 |
@@ -18,7 +18,8 @@ discard block |
||
18 | 18 | { |
19 | 19 | public function __construct( |
20 | 20 | private InputManager $input, |
21 | - ) {} |
|
21 | + ) { |
|
22 | +} |
|
22 | 23 | |
23 | 24 | public function withPrefix(string $prefix, bool $add = true): InputInterface |
24 | 25 | { |
@@ -30,7 +31,8 @@ discard block |
||
30 | 31 | |
31 | 32 | public function getValue(string $source, mixed $name = null): mixed |
32 | 33 | { |
33 | - if (!$this->input->hasBag($source) && !\method_exists($this->input, $source)) { |
|
34 | + if (!$this->input->hasBag($source) && !\method_exists($this->input, $source)) |
|
35 | + { |
|
34 | 36 | throw new InputException(\sprintf('Undefined input source %s', $source)); |
35 | 37 | } |
36 | 38 | |
@@ -39,7 +41,8 @@ discard block |
||
39 | 41 | |
40 | 42 | public function hasValue(string $source, string $name): bool |
41 | 43 | { |
42 | - if (!$this->input->hasBag($source)) { |
|
44 | + if (!$this->input->hasBag($source)) |
|
45 | + { |
|
43 | 46 | return false; |
44 | 47 | } |
45 | 48 |
@@ -11,7 +11,7 @@ |
||
11 | 11 | { |
12 | 12 | public function __construct( |
13 | 13 | private FileSnapshot $fileSnapshot, |
14 | - ) {} |
|
14 | + ){} |
|
15 | 15 | |
16 | 16 | public function report(\Throwable $exception): void |
17 | 17 | { |
@@ -11,7 +11,8 @@ |
||
11 | 11 | { |
12 | 12 | public function __construct( |
13 | 13 | private FileSnapshot $fileSnapshot, |
14 | - ) {} |
|
14 | + ) { |
|
15 | +} |
|
15 | 16 | |
16 | 17 | public function report(\Throwable $exception): void |
17 | 18 | { |
@@ -11,7 +11,7 @@ |
||
11 | 11 | { |
12 | 12 | public function __construct( |
13 | 13 | private StorageSnapshot $storageSnapshot, |
14 | - ) {} |
|
14 | + ){} |
|
15 | 15 | |
16 | 16 | public function report(\Throwable $exception): void |
17 | 17 | { |
@@ -11,7 +11,8 @@ |
||
11 | 11 | { |
12 | 12 | public function __construct( |
13 | 13 | private StorageSnapshot $storageSnapshot, |
14 | - ) {} |
|
14 | + ) { |
|
15 | +} |
|
15 | 16 | |
16 | 17 | public function report(\Throwable $exception): void |
17 | 18 | { |
@@ -15,7 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | public function __construct( |
17 | 17 | private readonly BinderInterface $binder, |
18 | - ) {} |
|
18 | + ){} |
|
19 | 19 | |
20 | 20 | public function defineDependencies(): array |
21 | 21 | { |
@@ -15,7 +15,8 @@ |
||
15 | 15 | { |
16 | 16 | public function __construct( |
17 | 17 | private readonly BinderInterface $binder, |
18 | - ) {} |
|
18 | + ) { |
|
19 | +} |
|
19 | 20 | |
20 | 21 | public function defineDependencies(): array |
21 | 22 | { |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public function __construct( |
23 | 23 | private readonly ConfiguratorInterface $config, |
24 | 24 | private readonly BinderInterface $binder, |
25 | - ) {} |
|
25 | + ){} |
|
26 | 26 | |
27 | 27 | public function defineBindings(): array |
28 | 28 | { |
@@ -53,12 +53,12 @@ discard block |
||
53 | 53 | |
54 | 54 | private function cookieQueue(ServerRequestInterface $request): CookieQueue |
55 | 55 | { |
56 | - try { |
|
56 | + try{ |
|
57 | 57 | return $request->getAttribute(CookieQueue::ATTRIBUTE) ?? throw new ContextualObjectNotFoundException( |
58 | 58 | CookieQueue::class, |
59 | 59 | CookieQueue::ATTRIBUTE, |
60 | 60 | ); |
61 | - } catch (InvalidRequestScopeException $e) { |
|
61 | + }catch (InvalidRequestScopeException $e){ |
|
62 | 62 | throw new InvalidRequestScopeException(CookieQueue::class, previous: $e); |
63 | 63 | } |
64 | 64 | } |
@@ -22,7 +22,8 @@ discard block |
||
22 | 22 | public function __construct( |
23 | 23 | private readonly ConfiguratorInterface $config, |
24 | 24 | private readonly BinderInterface $binder, |
25 | - ) {} |
|
25 | + ) { |
|
26 | +} |
|
26 | 27 | |
27 | 28 | public function defineBindings(): array |
28 | 29 | { |
@@ -53,12 +54,15 @@ discard block |
||
53 | 54 | |
54 | 55 | private function cookieQueue(ServerRequestInterface $request): CookieQueue |
55 | 56 | { |
56 | - try { |
|
57 | + try |
|
58 | + { |
|
57 | 59 | return $request->getAttribute(CookieQueue::ATTRIBUTE) ?? throw new ContextualObjectNotFoundException( |
58 | 60 | CookieQueue::class, |
59 | 61 | CookieQueue::ATTRIBUTE, |
60 | 62 | ); |
61 | - } catch (InvalidRequestScopeException $e) { |
|
63 | + } |
|
64 | + catch (InvalidRequestScopeException $e) |
|
65 | + { |
|
62 | 66 | throw new InvalidRequestScopeException(CookieQueue::class, previous: $e); |
63 | 67 | } |
64 | 68 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public function __construct( |
38 | 38 | private readonly ConfiguratorInterface $config, |
39 | 39 | private readonly BinderInterface $binder, |
40 | - ) {} |
|
40 | + ){} |
|
41 | 41 | |
42 | 42 | public function defineDependencies(): array |
43 | 43 | { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * |
117 | 117 | * @psalm-param MiddlewareInterface|Autowire|class-string<MiddlewareInterface> Middleware definition |
118 | 118 | */ |
119 | - public function addMiddleware(string|Autowire|MiddlewareInterface $middleware): void |
|
119 | + public function addMiddleware(string | Autowire | MiddlewareInterface $middleware): void |
|
120 | 120 | { |
121 | 121 | $this->config->modify(HttpConfig::CONFIG, new Append('middleware', null, $middleware)); |
122 | 122 | } |
@@ -37,7 +37,8 @@ |
||
37 | 37 | public function __construct( |
38 | 38 | private readonly ConfiguratorInterface $config, |
39 | 39 | private readonly BinderInterface $binder, |
40 | - ) {} |
|
40 | + ) { |
|
41 | +} |
|
41 | 42 | |
42 | 43 | public function defineDependencies(): array |
43 | 44 | { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public function __construct( |
42 | 42 | private readonly ConfiguratorInterface $config, |
43 | 43 | private readonly BinderInterface $binder, |
44 | - ) {} |
|
44 | + ){} |
|
45 | 45 | |
46 | 46 | public function defineDependencies(): array |
47 | 47 | { |
@@ -79,10 +79,10 @@ discard block |
||
79 | 79 | $groups->registerRoutes($router); |
80 | 80 | }; |
81 | 81 | |
82 | - if ($kernel instanceof Kernel) { |
|
82 | + if ($kernel instanceof Kernel){ |
|
83 | 83 | $kernel->appBooted($configuratorCallback); |
84 | 84 | $kernel->appBooted($groupsCallback); |
85 | - } else { |
|
85 | + }else{ |
|
86 | 86 | $kernel->booted($configuratorCallback); |
87 | 87 | $kernel->booted($groupsCallback); |
88 | 88 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | private function route(ServerRequestInterface $request): RouteInterface |
120 | 120 | { |
121 | 121 | $route = $request->getAttribute(Router::ROUTE_ATTRIBUTE, null); |
122 | - if ($route === null) { |
|
122 | + if ($route === null){ |
|
123 | 123 | throw new ScopeException('Unable to resolve Route, invalid request scope'); |
124 | 124 | } |
125 | 125 |
@@ -41,7 +41,8 @@ discard block |
||
41 | 41 | public function __construct( |
42 | 42 | private readonly ConfiguratorInterface $config, |
43 | 43 | private readonly BinderInterface $binder, |
44 | - ) {} |
|
44 | + ) { |
|
45 | +} |
|
45 | 46 | |
46 | 47 | public function defineDependencies(): array |
47 | 48 | { |
@@ -79,10 +80,13 @@ discard block |
||
79 | 80 | $groups->registerRoutes($router); |
80 | 81 | }; |
81 | 82 | |
82 | - if ($kernel instanceof Kernel) { |
|
83 | + if ($kernel instanceof Kernel) |
|
84 | + { |
|
83 | 85 | $kernel->appBooted($configuratorCallback); |
84 | 86 | $kernel->appBooted($groupsCallback); |
85 | - } else { |
|
87 | + } |
|
88 | + else |
|
89 | + { |
|
86 | 90 | $kernel->booted($configuratorCallback); |
87 | 91 | $kernel->booted($groupsCallback); |
88 | 92 | } |
@@ -119,7 +123,8 @@ discard block |
||
119 | 123 | private function route(ServerRequestInterface $request): RouteInterface |
120 | 124 | { |
121 | 125 | $route = $request->getAttribute(Router::ROUTE_ATTRIBUTE, null); |
122 | - if ($route === null) { |
|
126 | + if ($route === null) |
|
127 | + { |
|
123 | 128 | throw new ScopeException('Unable to resolve Route, invalid request scope'); |
124 | 129 | } |
125 | 130 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | { |
27 | 27 | public function __construct( |
28 | 28 | private readonly BinderInterface $binder, |
29 | - ) {} |
|
29 | + ){} |
|
30 | 30 | |
31 | 31 | public function defineBindings(): array |
32 | 32 | { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | 'handler' => new Autowire( |
71 | 71 | FileHandler::class, |
72 | 72 | [ |
73 | - 'directory' => $directories->get('runtime') . 'session', |
|
73 | + 'directory' => $directories->get('runtime').'session', |
|
74 | 74 | 'lifetime' => 86400, |
75 | 75 | ], |
76 | 76 | ), |
@@ -89,14 +89,14 @@ discard block |
||
89 | 89 | |
90 | 90 | private function resolveSession(ContainerInterface $container): SessionInterface |
91 | 91 | { |
92 | - try { |
|
92 | + try{ |
|
93 | 93 | /** @var ServerRequestInterface $request */ |
94 | 94 | $request = $container->get(ServerRequestInterface::class); |
95 | 95 | return $request->getAttribute(SessionMiddleware::ATTRIBUTE) ?? throw new ContextualObjectNotFoundException( |
96 | 96 | SessionInterface::class, |
97 | 97 | SessionMiddleware::ATTRIBUTE, |
98 | 98 | ); |
99 | - } catch (InvalidRequestScopeException $e) { |
|
99 | + }catch (InvalidRequestScopeException $e){ |
|
100 | 100 | throw new InvalidRequestScopeException(SessionInterface::class, previous: $e); |
101 | 101 | } |
102 | 102 | } |
@@ -26,7 +26,8 @@ discard block |
||
26 | 26 | { |
27 | 27 | public function __construct( |
28 | 28 | private readonly BinderInterface $binder, |
29 | - ) {} |
|
29 | + ) { |
|
30 | +} |
|
30 | 31 | |
31 | 32 | public function defineBindings(): array |
32 | 33 | { |
@@ -89,14 +90,17 @@ discard block |
||
89 | 90 | |
90 | 91 | private function resolveSession(ContainerInterface $container): SessionInterface |
91 | 92 | { |
92 | - try { |
|
93 | + try |
|
94 | + { |
|
93 | 95 | /** @var ServerRequestInterface $request */ |
94 | 96 | $request = $container->get(ServerRequestInterface::class); |
95 | 97 | return $request->getAttribute(SessionMiddleware::ATTRIBUTE) ?? throw new ContextualObjectNotFoundException( |
96 | 98 | SessionInterface::class, |
97 | 99 | SessionMiddleware::ATTRIBUTE, |
98 | 100 | ); |
99 | - } catch (InvalidRequestScopeException $e) { |
|
101 | + } |
|
102 | + catch (InvalidRequestScopeException $e) |
|
103 | + { |
|
100 | 104 | throw new InvalidRequestScopeException(SessionInterface::class, previous: $e); |
101 | 105 | } |
102 | 106 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | { |
13 | 13 | public function __construct( |
14 | 14 | private readonly ConfiguratorInterface $config, |
15 | - ) {} |
|
15 | + ){} |
|
16 | 16 | |
17 | 17 | public function init(HttpBootloader $http): void |
18 | 18 | { |
@@ -12,7 +12,8 @@ |
||
12 | 12 | { |
13 | 13 | public function __construct( |
14 | 14 | private readonly ConfiguratorInterface $config, |
15 | - ) {} |
|
15 | + ) { |
|
16 | +} |
|
16 | 17 | |
17 | 18 | public function init(HttpBootloader $http): void |
18 | 19 | { |