@@ -21,10 +21,10 @@ discard block |
||
21 | 21 | $container = new Container(); |
22 | 22 | |
23 | 23 | $container->runScoped(static function (Container $c1): void { |
24 | - try { |
|
24 | + try{ |
|
25 | 25 | $c1->get(ExceptionConstructor::class); |
26 | 26 | self::fail('Exception should be thrown'); |
27 | - } catch (\Throwable $e) { |
|
27 | + }catch (\Throwable $e){ |
|
28 | 28 | self::assertInstanceOf(\Exception::class, $e); |
29 | 29 | throw $e; |
30 | 30 | } |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | $container = new Container(); |
40 | 40 | |
41 | 41 | $container->runScoped(static function (Container $c1): void { |
42 | - try { |
|
42 | + try{ |
|
43 | 43 | $c1->get(ExceptionConstructor::class); |
44 | 44 | self::fail('Exception should be thrown'); |
45 | - } catch (\Throwable $e) { |
|
45 | + }catch (\Throwable $e){ |
|
46 | 46 | self::assertInstanceOf(\Exception::class, $e); |
47 | 47 | throw $e; |
48 | 48 | } |
@@ -57,10 +57,10 @@ discard block |
||
57 | 57 | $container = new Container(); |
58 | 58 | |
59 | 59 | $container->runScoped(static function (Container $c1): void { |
60 | - try { |
|
60 | + try{ |
|
61 | 61 | $c1->get(DatetimeCarrier::class); |
62 | 62 | self::fail('Exception should be thrown'); |
63 | - } catch (\Throwable $e) { |
|
63 | + }catch (\Throwable $e){ |
|
64 | 64 | self::assertInstanceOf(NotFoundException::class, $e); |
65 | 65 | self::assertInstanceOf(NotFoundException::class, $e->getPrevious()); |
66 | 66 | self::assertStringContainsString( |
@@ -21,10 +21,13 @@ discard block |
||
21 | 21 | $container = new Container(); |
22 | 22 | |
23 | 23 | $container->runScoped(static function (Container $c1): void { |
24 | - try { |
|
24 | + try |
|
25 | + { |
|
25 | 26 | $c1->get(ExceptionConstructor::class); |
26 | 27 | self::fail('Exception should be thrown'); |
27 | - } catch (\Throwable $e) { |
|
28 | + } |
|
29 | + catch (\Throwable $e) |
|
30 | + { |
|
28 | 31 | self::assertInstanceOf(\Exception::class, $e); |
29 | 32 | throw $e; |
30 | 33 | } |
@@ -39,10 +42,13 @@ discard block |
||
39 | 42 | $container = new Container(); |
40 | 43 | |
41 | 44 | $container->runScoped(static function (Container $c1): void { |
42 | - try { |
|
45 | + try |
|
46 | + { |
|
43 | 47 | $c1->get(ExceptionConstructor::class); |
44 | 48 | self::fail('Exception should be thrown'); |
45 | - } catch (\Throwable $e) { |
|
49 | + } |
|
50 | + catch (\Throwable $e) |
|
51 | + { |
|
46 | 52 | self::assertInstanceOf(\Exception::class, $e); |
47 | 53 | throw $e; |
48 | 54 | } |
@@ -57,10 +63,13 @@ discard block |
||
57 | 63 | $container = new Container(); |
58 | 64 | |
59 | 65 | $container->runScoped(static function (Container $c1): void { |
60 | - try { |
|
66 | + try |
|
67 | + { |
|
61 | 68 | $c1->get(DatetimeCarrier::class); |
62 | 69 | self::fail('Exception should be thrown'); |
63 | - } catch (\Throwable $e) { |
|
70 | + } |
|
71 | + catch (\Throwable $e) |
|
72 | + { |
|
64 | 73 | self::assertInstanceOf(NotFoundException::class, $e); |
65 | 74 | self::assertInstanceOf(NotFoundException::class, $e->getPrevious()); |
66 | 75 | self::assertStringContainsString( |
@@ -28,7 +28,8 @@ |
||
28 | 28 | |
29 | 29 | public function setUp(): void |
30 | 30 | { |
31 | - $this->trait = new class { |
|
31 | + $this->trait = new class |
|
32 | + { |
|
32 | 33 | use GuardedTrait; |
33 | 34 | }; |
34 | 35 | $this->guard = $this->createMock(GuardInterface::class); |
@@ -87,7 +87,7 @@ |
||
87 | 87 | self::assertSame(static::OPERATION, $guarded->resolvePermission(static::OPERATION)); |
88 | 88 | |
89 | 89 | $guarded = new GuardedWithNamespace(); |
90 | - $resolvedPermission = GuardedWithNamespace::GUARD_NAMESPACE . '.' . static::OPERATION; |
|
90 | + $resolvedPermission = GuardedWithNamespace::GUARD_NAMESPACE.'.'.static::OPERATION; |
|
91 | 91 | self::assertSame($resolvedPermission, $guarded->resolvePermission(static::OPERATION)); |
92 | 92 | } |
93 | 93 | } |
@@ -21,7 +21,8 @@ |
||
21 | 21 | |
22 | 22 | public function setUp(): void |
23 | 23 | { |
24 | - $this->trait = new class { |
|
24 | + $this->trait = new class |
|
25 | + { |
|
25 | 26 | use LimitsTrait; |
26 | 27 | }; |
27 | 28 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | public function __construct( |
26 | 26 | private readonly CookiesConfig $config, |
27 | 27 | private readonly EncryptionInterface $encryption |
28 | - ) { |
|
28 | + ){ |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | public function process(Request $request, RequestHandlerInterface $handler): Response |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | { |
51 | 51 | $cookies = $request->getCookieParams(); |
52 | 52 | |
53 | - foreach ($cookies as $name => $cookie) { |
|
54 | - if (!$this->isProtected($name)) { |
|
53 | + foreach ($cookies as $name => $cookie){ |
|
54 | + if (!$this->isProtected($name)){ |
|
55 | 55 | continue; |
56 | 56 | } |
57 | 57 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | protected function isProtected(string $cookie): bool |
68 | 68 | { |
69 | - if (\in_array($cookie, $this->config->getExcludedCookies(), true)) { |
|
69 | + if (\in_array($cookie, $this->config->getExcludedCookies(), true)){ |
|
70 | 70 | //Excluded |
71 | 71 | return false; |
72 | 72 | } |
@@ -81,14 +81,14 @@ discard block |
||
81 | 81 | */ |
82 | 82 | protected function packCookies(Response $response, CookieQueue $queue): Response |
83 | 83 | { |
84 | - if (empty($queue->getScheduled())) { |
|
84 | + if (empty($queue->getScheduled())){ |
|
85 | 85 | return $response; |
86 | 86 | } |
87 | 87 | |
88 | 88 | $cookies = $response->getHeader('Set-Cookie'); |
89 | 89 | |
90 | - foreach ($queue->getScheduled() as $cookie) { |
|
91 | - if (empty($cookie->getValue()) || !$this->isProtected($cookie->getName())) { |
|
90 | + foreach ($queue->getScheduled() as $cookie){ |
|
91 | + if (empty($cookie->getValue()) || !$this->isProtected($cookie->getName())){ |
|
92 | 92 | $cookies[] = $cookie->createHeader(); |
93 | 93 | continue; |
94 | 94 | } |
@@ -99,28 +99,28 @@ discard block |
||
99 | 99 | return $response->withHeader('Set-Cookie', $cookies); |
100 | 100 | } |
101 | 101 | |
102 | - private function decodeCookie(array|string $cookie): mixed |
|
102 | + private function decodeCookie(array | string $cookie): mixed |
|
103 | 103 | { |
104 | - try { |
|
105 | - if (\is_array($cookie)) { |
|
106 | - return \array_map(fn (array|string $cookie): mixed => $this->decodeCookie($cookie), $cookie); |
|
104 | + try{ |
|
105 | + if (\is_array($cookie)){ |
|
106 | + return \array_map(fn (array | string $cookie): mixed => $this->decodeCookie($cookie), $cookie); |
|
107 | 107 | } |
108 | - } catch (DecryptException) { |
|
108 | + }catch (DecryptException){ |
|
109 | 109 | return null; |
110 | 110 | } |
111 | 111 | |
112 | - switch ($this->config->getProtectionMethod()) { |
|
112 | + switch ($this->config->getProtectionMethod()){ |
|
113 | 113 | case CookiesConfig::COOKIE_ENCRYPT: |
114 | - try { |
|
114 | + try{ |
|
115 | 115 | return $this->encryption->getEncrypter()->decrypt($cookie); |
116 | - } catch (DecryptException) { |
|
116 | + }catch (DecryptException){ |
|
117 | 117 | } |
118 | 118 | return null; |
119 | 119 | case CookiesConfig::COOKIE_HMAC: |
120 | 120 | $hmac = \substr($cookie, -1 * CookiesConfig::MAC_LENGTH); |
121 | 121 | $value = \substr($cookie, 0, \strlen($cookie) - \strlen($hmac)); |
122 | 122 | |
123 | - if (\hash_equals($this->hmacSign($value), $hmac)) { |
|
123 | + if (\hash_equals($this->hmacSign($value), $hmac)){ |
|
124 | 124 | return $value; |
125 | 125 | } |
126 | 126 | } |
@@ -143,13 +143,13 @@ discard block |
||
143 | 143 | private function encodeCookie(Cookie $cookie): Cookie |
144 | 144 | { |
145 | 145 | $value = $cookie->getValue() ?? ''; |
146 | - if ($this->config->getProtectionMethod() === CookiesConfig::COOKIE_ENCRYPT) { |
|
146 | + if ($this->config->getProtectionMethod() === CookiesConfig::COOKIE_ENCRYPT){ |
|
147 | 147 | $encryptor = $this->encryption->getEncrypter(); |
148 | 148 | |
149 | 149 | return $cookie->withValue($encryptor->encrypt($value)); |
150 | 150 | } |
151 | 151 | |
152 | 152 | //VALUE.HMAC |
153 | - return $cookie->withValue($value . $this->hmacSign($value)); |
|
153 | + return $cookie->withValue($value.$this->hmacSign($value)); |
|
154 | 154 | } |
155 | 155 | } |
@@ -50,8 +50,10 @@ discard block |
||
50 | 50 | { |
51 | 51 | $cookies = $request->getCookieParams(); |
52 | 52 | |
53 | - foreach ($cookies as $name => $cookie) { |
|
54 | - if (!$this->isProtected($name)) { |
|
53 | + foreach ($cookies as $name => $cookie) |
|
54 | + { |
|
55 | + if (!$this->isProtected($name)) |
|
56 | + { |
|
55 | 57 | continue; |
56 | 58 | } |
57 | 59 | |
@@ -66,7 +68,8 @@ discard block |
||
66 | 68 | */ |
67 | 69 | protected function isProtected(string $cookie): bool |
68 | 70 | { |
69 | - if (\in_array($cookie, $this->config->getExcludedCookies(), true)) { |
|
71 | + if (\in_array($cookie, $this->config->getExcludedCookies(), true)) |
|
72 | + { |
|
70 | 73 | //Excluded |
71 | 74 | return false; |
72 | 75 | } |
@@ -81,14 +84,17 @@ discard block |
||
81 | 84 | */ |
82 | 85 | protected function packCookies(Response $response, CookieQueue $queue): Response |
83 | 86 | { |
84 | - if (empty($queue->getScheduled())) { |
|
87 | + if (empty($queue->getScheduled())) |
|
88 | + { |
|
85 | 89 | return $response; |
86 | 90 | } |
87 | 91 | |
88 | 92 | $cookies = $response->getHeader('Set-Cookie'); |
89 | 93 | |
90 | - foreach ($queue->getScheduled() as $cookie) { |
|
91 | - if (empty($cookie->getValue()) || !$this->isProtected($cookie->getName())) { |
|
94 | + foreach ($queue->getScheduled() as $cookie) |
|
95 | + { |
|
96 | + if (empty($cookie->getValue()) || !$this->isProtected($cookie->getName())) |
|
97 | + { |
|
92 | 98 | $cookies[] = $cookie->createHeader(); |
93 | 99 | continue; |
94 | 100 | } |
@@ -101,26 +107,35 @@ discard block |
||
101 | 107 | |
102 | 108 | private function decodeCookie(array|string $cookie): mixed |
103 | 109 | { |
104 | - try { |
|
105 | - if (\is_array($cookie)) { |
|
110 | + try |
|
111 | + { |
|
112 | + if (\is_array($cookie)) |
|
113 | + { |
|
106 | 114 | return \array_map(fn (array|string $cookie): mixed => $this->decodeCookie($cookie), $cookie); |
107 | 115 | } |
108 | - } catch (DecryptException) { |
|
116 | + } |
|
117 | + catch (DecryptException) |
|
118 | + { |
|
109 | 119 | return null; |
110 | 120 | } |
111 | 121 | |
112 | - switch ($this->config->getProtectionMethod()) { |
|
122 | + switch ($this->config->getProtectionMethod()) |
|
123 | + { |
|
113 | 124 | case CookiesConfig::COOKIE_ENCRYPT: |
114 | - try { |
|
125 | + try |
|
126 | + { |
|
115 | 127 | return $this->encryption->getEncrypter()->decrypt($cookie); |
116 | - } catch (DecryptException) { |
|
128 | + } |
|
129 | + catch (DecryptException) |
|
130 | + { |
|
117 | 131 | } |
118 | 132 | return null; |
119 | 133 | case CookiesConfig::COOKIE_HMAC: |
120 | 134 | $hmac = \substr($cookie, -1 * CookiesConfig::MAC_LENGTH); |
121 | 135 | $value = \substr($cookie, 0, \strlen($cookie) - \strlen($hmac)); |
122 | 136 | |
123 | - if (\hash_equals($this->hmacSign($value), $hmac)) { |
|
137 | + if (\hash_equals($this->hmacSign($value), $hmac)) |
|
138 | + { |
|
124 | 139 | return $value; |
125 | 140 | } |
126 | 141 | } |
@@ -143,7 +158,8 @@ discard block |
||
143 | 158 | private function encodeCookie(Cookie $cookie): Cookie |
144 | 159 | { |
145 | 160 | $value = $cookie->getValue() ?? ''; |
146 | - if ($this->config->getProtectionMethod() === CookiesConfig::COOKIE_ENCRYPT) { |
|
161 | + if ($this->config->getProtectionMethod() === CookiesConfig::COOKIE_ENCRYPT) |
|
162 | + { |
|
147 | 163 | $encryptor = $this->encryption->getEncrypter(); |
148 | 164 | |
149 | 165 | return $cookie->withValue($encryptor->encrypt($value)); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | // from the current `foo` scope |
50 | 50 | self::assertInstanceOf(KVLogger::class, $logger); |
51 | 51 | |
52 | - for ($i = 0; $i < 10; $i++) { |
|
52 | + for ($i = 0; $i < 10; $i++){ |
|
53 | 53 | // because of proxy |
54 | 54 | self::assertNotInstanceOf(KVLogger::class, $carrier->getLogger()); |
55 | 55 | self::assertSame('kv', $carrier->logger->getName()); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | // from the current `foo` scope |
70 | 70 | self::assertInstanceOf(FileLogger::class, $logger); |
71 | 71 | |
72 | - for ($i = 0; $i < 10; $i++) { |
|
72 | + for ($i = 0; $i < 10; $i++){ |
|
73 | 73 | // because of proxy |
74 | 74 | self::assertNotInstanceOf(FileLogger::class, $carrier->getLogger()); |
75 | 75 | self::assertSame('file', $carrier->logger->getName()); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | ->bind( |
138 | 138 | ContextInterface::class, |
139 | 139 | new \Spiral\Core\Config\Injectable( |
140 | - new class implements InjectorInterface { |
|
140 | + new class implements InjectorInterface{ |
|
141 | 141 | public function createInjection(\ReflectionClass $class, mixed $context = null): Context |
142 | 142 | { |
143 | 143 | return new Context($context); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | ->bind( |
179 | 179 | ContextInterface::class, |
180 | 180 | new \Spiral\Core\Config\Injectable( |
181 | - new class implements InjectorInterface { |
|
181 | + new class implements InjectorInterface{ |
|
182 | 182 | public function createInjection(\ReflectionClass $class, mixed $context = null): Context |
183 | 183 | { |
184 | 184 | return new Context($context); |
@@ -189,14 +189,14 @@ discard block |
||
189 | 189 | |
190 | 190 | FiberHelper::runFiberSequence( |
191 | 191 | static fn(): mixed => $root->runScope(new Scope(name: 'foo'), static function (ContextInterface $ctx): void { |
192 | - for ($i = 0; $i < 10; $i++) { |
|
192 | + for ($i = 0; $i < 10; $i++){ |
|
193 | 193 | self::assertInstanceOf(ReflectionParameter::class, $ctx->getValue(), 'Context injected'); |
194 | 194 | self::assertSame('ctx', $ctx->getValue()->getName()); |
195 | 195 | \Fiber::suspend(); |
196 | 196 | } |
197 | 197 | }), |
198 | 198 | static fn(): mixed => $root->runScope(new Scope(name: 'foo'), static function (ContextInterface $context): void { |
199 | - for ($i = 0; $i < 10; $i++) { |
|
199 | + for ($i = 0; $i < 10; $i++){ |
|
200 | 200 | self::assertInstanceOf(ReflectionParameter::class, $context->getValue(), 'Context injected'); |
201 | 201 | self::assertSame('context', $context->getValue()->getName()); |
202 | 202 | \Fiber::suspend(); |
@@ -257,10 +257,10 @@ discard block |
||
257 | 257 | { |
258 | 258 | $root = new Container(); |
259 | 259 | $context = (object)['destroyed' => false]; |
260 | - $class = new class($context) implements DestroyableInterface { |
|
260 | + $class = new class($context) implements DestroyableInterface{ |
|
261 | 261 | public function __construct( |
262 | 262 | private readonly \stdClass $context, |
263 | - ) { |
|
263 | + ){ |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | public function __destruct() |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | new Scope('http'), |
289 | 289 | static function () use ($root, $proxy): void { |
290 | 290 | self::assertSame('Foo', $proxy->getName()); |
291 | - $proxy->setName(new class implements \Stringable { |
|
291 | + $proxy->setName(new class implements \Stringable{ |
|
292 | 292 | public function __toString(): string |
293 | 293 | { |
294 | 294 | return 'Bar'; |
@@ -49,7 +49,8 @@ discard block |
||
49 | 49 | // from the current `foo` scope |
50 | 50 | self::assertInstanceOf(KVLogger::class, $logger); |
51 | 51 | |
52 | - for ($i = 0; $i < 10; $i++) { |
|
52 | + for ($i = 0; $i < 10; $i++) |
|
53 | + { |
|
53 | 54 | // because of proxy |
54 | 55 | self::assertNotInstanceOf(KVLogger::class, $carrier->getLogger()); |
55 | 56 | self::assertSame('kv', $carrier->logger->getName()); |
@@ -69,7 +70,8 @@ discard block |
||
69 | 70 | // from the current `foo` scope |
70 | 71 | self::assertInstanceOf(FileLogger::class, $logger); |
71 | 72 | |
72 | - for ($i = 0; $i < 10; $i++) { |
|
73 | + for ($i = 0; $i < 10; $i++) |
|
74 | + { |
|
73 | 75 | // because of proxy |
74 | 76 | self::assertNotInstanceOf(FileLogger::class, $carrier->getLogger()); |
75 | 77 | self::assertSame('file', $carrier->logger->getName()); |
@@ -137,7 +139,8 @@ discard block |
||
137 | 139 | ->bind( |
138 | 140 | ContextInterface::class, |
139 | 141 | new \Spiral\Core\Config\Injectable( |
140 | - new class implements InjectorInterface { |
|
142 | + new class implements InjectorInterface |
|
143 | + { |
|
141 | 144 | public function createInjection(\ReflectionClass $class, mixed $context = null): Context |
142 | 145 | { |
143 | 146 | return new Context($context); |
@@ -178,7 +181,8 @@ discard block |
||
178 | 181 | ->bind( |
179 | 182 | ContextInterface::class, |
180 | 183 | new \Spiral\Core\Config\Injectable( |
181 | - new class implements InjectorInterface { |
|
184 | + new class implements InjectorInterface |
|
185 | + { |
|
182 | 186 | public function createInjection(\ReflectionClass $class, mixed $context = null): Context |
183 | 187 | { |
184 | 188 | return new Context($context); |
@@ -189,14 +193,16 @@ discard block |
||
189 | 193 | |
190 | 194 | FiberHelper::runFiberSequence( |
191 | 195 | static fn(): mixed => $root->runScope(new Scope(name: 'foo'), static function (ContextInterface $ctx): void { |
192 | - for ($i = 0; $i < 10; $i++) { |
|
196 | + for ($i = 0; $i < 10; $i++) |
|
197 | + { |
|
193 | 198 | self::assertInstanceOf(ReflectionParameter::class, $ctx->getValue(), 'Context injected'); |
194 | 199 | self::assertSame('ctx', $ctx->getValue()->getName()); |
195 | 200 | \Fiber::suspend(); |
196 | 201 | } |
197 | 202 | }), |
198 | 203 | static fn(): mixed => $root->runScope(new Scope(name: 'foo'), static function (ContextInterface $context): void { |
199 | - for ($i = 0; $i < 10; $i++) { |
|
204 | + for ($i = 0; $i < 10; $i++) |
|
205 | + { |
|
200 | 206 | self::assertInstanceOf(ReflectionParameter::class, $context->getValue(), 'Context injected'); |
201 | 207 | self::assertSame('context', $context->getValue()->getName()); |
202 | 208 | \Fiber::suspend(); |
@@ -257,7 +263,8 @@ discard block |
||
257 | 263 | { |
258 | 264 | $root = new Container(); |
259 | 265 | $context = (object)['destroyed' => false]; |
260 | - $class = new class($context) implements DestroyableInterface { |
|
266 | + $class = new class($context) implements DestroyableInterface |
|
267 | + { |
|
261 | 268 | public function __construct( |
262 | 269 | private readonly \stdClass $context, |
263 | 270 | ) { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | public function testMiddlewareProcessingEventShouldBeDispatched(): void |
62 | 62 | { |
63 | - $middleware = new class implements MiddlewareInterface { |
|
63 | + $middleware = new class implements MiddlewareInterface{ |
|
64 | 64 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
65 | 65 | { |
66 | 66 | return (new ResponseFactory(new HttpConfig(['headers' => []])))->createResponse(200); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $this->container->getBinder('http') |
90 | 90 | ->bind(ServerRequestInterface::class, static fn(CurrentRequest $cr): ?ServerRequestInterface => $cr->get()); |
91 | 91 | |
92 | - $middleware = new class implements MiddlewareInterface { |
|
92 | + $middleware = new class implements MiddlewareInterface{ |
|
93 | 93 | public function process( |
94 | 94 | ServerRequestInterface $request, |
95 | 95 | RequestHandlerInterface $handler, |
@@ -60,7 +60,8 @@ discard block |
||
60 | 60 | |
61 | 61 | public function testMiddlewareProcessingEventShouldBeDispatched(): void |
62 | 62 | { |
63 | - $middleware = new class implements MiddlewareInterface { |
|
63 | + $middleware = new class implements MiddlewareInterface |
|
64 | + { |
|
64 | 65 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
65 | 66 | { |
66 | 67 | return (new ResponseFactory(new HttpConfig(['headers' => []])))->createResponse(200); |
@@ -89,7 +90,8 @@ discard block |
||
89 | 90 | $this->container->getBinder('http') |
90 | 91 | ->bind(ServerRequestInterface::class, static fn(CurrentRequest $cr): ?ServerRequestInterface => $cr->get()); |
91 | 92 | |
92 | - $middleware = new class implements MiddlewareInterface { |
|
93 | + $middleware = new class implements MiddlewareInterface |
|
94 | + { |
|
93 | 95 | public function process( |
94 | 96 | ServerRequestInterface $request, |
95 | 97 | RequestHandlerInterface $handler, |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | protected function formatTopics(array $topics): array |
18 | 18 | { |
19 | - return \array_map(static fn (string|\Stringable $topic): string => (string) $topic, $topics); |
|
19 | + return \array_map(static fn (string | \Stringable $topic): string => (string)$topic, $topics); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * @param iterable<T>|T $entries |
25 | 25 | * @return array<T> |
26 | 26 | */ |
27 | - protected function toArray(iterable|string|\Stringable $entries): array |
|
27 | + protected function toArray(iterable | string | \Stringable $entries): array |
|
28 | 28 | { |
29 | 29 | return match (true) { |
30 | 30 | \is_array($entries) => $entries, |
@@ -78,7 +78,7 @@ |
||
78 | 78 | $this->getContainer()->removeBinding(CoreInterface::class); |
79 | 79 | |
80 | 80 | $core = $target->getHandler($this->getContainer(), []); |
81 | - $handler = (fn(CoreHandler $core): HandlerInterface|CoreInterface => $core->core)->call($core, $core); |
|
81 | + $handler = (fn(CoreHandler $core): HandlerInterface | CoreInterface => $core->core)->call($core, $core); |
|
82 | 82 | |
83 | 83 | self::assertInstanceOf(AutowireHandler::class, $handler); |
84 | 84 | } |
@@ -57,13 +57,13 @@ |
||
57 | 57 | |
58 | 58 | $this->mailer->expects('send')->with($email)->andThrow(new TransportException('failed')); |
59 | 59 | |
60 | - try { |
|
60 | + try{ |
|
61 | 61 | $this->getHandler()->handle( |
62 | 62 | MailQueue::JOB_NAME, |
63 | 63 | 'id', |
64 | 64 | json_encode(MessageSerializer::pack($this->getMail())) |
65 | 65 | ); |
66 | - } catch (TransportException) { |
|
66 | + }catch (TransportException){ |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 |
@@ -57,13 +57,16 @@ |
||
57 | 57 | |
58 | 58 | $this->mailer->expects('send')->with($email)->andThrow(new TransportException('failed')); |
59 | 59 | |
60 | - try { |
|
60 | + try |
|
61 | + { |
|
61 | 62 | $this->getHandler()->handle( |
62 | 63 | MailQueue::JOB_NAME, |
63 | 64 | 'id', |
64 | 65 | json_encode(MessageSerializer::pack($this->getMail())) |
65 | 66 | ); |
66 | - } catch (TransportException) { |
|
67 | + } |
|
68 | + catch (TransportException) |
|
69 | + { |
|
67 | 70 | } |
68 | 71 | } |
69 | 72 |