@@ -41,7 +41,8 @@ discard block |
||
41 | 41 | |
42 | 42 | public function testHandleWithHandleMethod(): void |
43 | 43 | { |
44 | - $object = new class($this) { |
|
44 | + $object = new class($this) |
|
45 | + { |
|
45 | 46 | private $testCase; |
46 | 47 | |
47 | 48 | public function __construct($testCase) |
@@ -64,7 +65,8 @@ discard block |
||
64 | 65 | |
65 | 66 | public function testHandleWithInvokeMethod(): void |
66 | 67 | { |
67 | - $object = new class($this) { |
|
68 | + $object = new class($this) |
|
69 | + { |
|
68 | 70 | private $testCase; |
69 | 71 | |
70 | 72 | public function __construct($testCase) |
@@ -28,7 +28,7 @@ |
||
28 | 28 | /** @var AuthContextInterface $authContext */ |
29 | 29 | $authContext = $request->getAttribute(AuthMiddleware::ATTRIBUTE); |
30 | 30 | |
31 | - if ($authContext === null || $authContext->getActor() === null) { |
|
31 | + if ($authContext === null || $authContext->getActor() === null){ |
|
32 | 32 | return $this->denyAccess($request, $handler); |
33 | 33 | } |
34 | 34 |
@@ -28,7 +28,8 @@ |
||
28 | 28 | /** @var AuthContextInterface $authContext */ |
29 | 29 | $authContext = $request->getAttribute(AuthMiddleware::ATTRIBUTE); |
30 | 30 | |
31 | - if ($authContext === null || $authContext->getActor() === null) { |
|
31 | + if ($authContext === null || $authContext->getActor() === null) |
|
32 | + { |
|
32 | 33 | return $this->denyAccess($request, $handler); |
33 | 34 | } |
34 | 35 |
@@ -33,7 +33,8 @@ |
||
33 | 33 | // Replaces alias with real storage name |
34 | 34 | $name = $this->config->getAliases()[$name] ?? $name; |
35 | 35 | |
36 | - if (isset($this->storages[$name])) { |
|
36 | + if (isset($this->storages[$name])) |
|
37 | + { |
|
37 | 38 | return $this->storages[$name]; |
38 | 39 | } |
39 | 40 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | public function __construct( |
18 | 18 | private readonly CacheConfig $config, |
19 | 19 | private readonly FactoryInterface $factory |
20 | - ) { |
|
20 | + ){ |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public function storage(?string $name = null): CacheInterface |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | // Replaces alias with real storage name |
28 | 28 | $name = $this->config->getAliases()[$name] ?? $name; |
29 | 29 | |
30 | - if (isset($this->storages[$name])) { |
|
30 | + if (isset($this->storages[$name])){ |
|
31 | 31 | return $this->storages[$name]; |
32 | 32 | } |
33 | 33 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | public function testGetsWithExistsValueAndCacheFile(): void |
39 | 39 | { |
40 | 40 | $ttl = time() + self::DEFAULT_TTL; |
41 | - $value = $ttl . 's:3:"bar";'; |
|
41 | + $value = $ttl.'s:3:"bar";'; |
|
42 | 42 | $path = self::DEFAULT_PATH; |
43 | 43 | |
44 | 44 | $this->files->shouldReceive('read')->with($path)->andReturn($value); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | { |
62 | 62 | $path = self::DEFAULT_PATH; |
63 | 63 | |
64 | - $this->files->shouldReceive('read')->with($path)->andReturn(time() . 's:3:"bar";'); |
|
64 | + $this->files->shouldReceive('read')->with($path)->andReturn(time().'s:3:"bar";'); |
|
65 | 65 | $this->files->shouldReceive('exists')->with($path)->andReturn(true); |
66 | 66 | $this->files->shouldReceive('delete')->with($path)->andReturnTrue(); |
67 | 67 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public function testGetsWithExistsValueWithDeadValue(): void |
72 | 72 | { |
73 | 73 | $ttl = time() + self::DEFAULT_TTL; |
74 | - $value = $ttl . 's:3:"barbar";'; |
|
74 | + $value = $ttl.'s:3:"barbar";'; |
|
75 | 75 | $path = self::DEFAULT_PATH; |
76 | 76 | |
77 | 77 | $this->files->shouldReceive('read')->with($path)->andReturn($value); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | public function testSetsWithDefaultTTL(): void |
85 | 85 | { |
86 | 86 | $ttl = time() + self::DEFAULT_TTL; |
87 | - $value = $ttl . 's:3:"bar";'; |
|
87 | + $value = $ttl.'s:3:"bar";'; |
|
88 | 88 | |
89 | 89 | $this->files->shouldReceive('write')->with(self::DEFAULT_PATH, $value, null, true)->andReturnTrue(); |
90 | 90 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | public function testSetsWithTTLInSeconds(): void |
95 | 95 | { |
96 | 96 | $ttl = time() + 30; |
97 | - $value = $ttl . 's:3:"bar";'; |
|
97 | + $value = $ttl.'s:3:"bar";'; |
|
98 | 98 | |
99 | 99 | $this->files->shouldReceive('write')->with(self::DEFAULT_PATH, $value, null, true)->andReturnTrue(); |
100 | 100 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | public function testSetsWithTTLInDateInterval(): void |
105 | 105 | { |
106 | 106 | $ttl = time() + 30; |
107 | - $value = $ttl . 's:3:"bar";'; |
|
107 | + $value = $ttl.'s:3:"bar";'; |
|
108 | 108 | |
109 | 109 | $this->files->shouldReceive('write')->with(self::DEFAULT_PATH, $value, null, true)->andReturnTrue(); |
110 | 110 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | public function testSetsWithTTLInDateTime(): void |
115 | 115 | { |
116 | 116 | $ttl = time() + 30; |
117 | - $value = $ttl . 's:3:"bar";'; |
|
117 | + $value = $ttl.'s:3:"bar";'; |
|
118 | 118 | |
119 | 119 | $this->files->shouldReceive('write')->with(self::DEFAULT_PATH, $value, null, true)->andReturnTrue(); |
120 | 120 | |
@@ -161,15 +161,15 @@ discard block |
||
161 | 161 | { |
162 | 162 | $this->files->shouldReceive('read')->with( |
163 | 163 | 'path/to/cache/0b/ee/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33' |
164 | - )->andReturn((time() + self::DEFAULT_TTL) . 's:3:"abc";'); |
|
164 | + )->andReturn((time() + self::DEFAULT_TTL).'s:3:"abc";'); |
|
165 | 165 | |
166 | 166 | $this->files->shouldReceive('read')->with( |
167 | 167 | 'path/to/cache/62/cd/62cdb7020ff920e5aa642c3d4066950dd1f01f4d' |
168 | - )->andReturn((time() + self::DEFAULT_TTL) . 's:3:"cde";'); |
|
168 | + )->andReturn((time() + self::DEFAULT_TTL).'s:3:"cde";'); |
|
169 | 169 | |
170 | 170 | $this->files->shouldReceive('read')->with( |
171 | 171 | 'path/to/cache/bb/e9/bbe960a25ea311d21d40669e93df2003ba9b90a2' |
172 | - )->andReturn((time() + -1) . 's:3:"efg";'); |
|
172 | + )->andReturn((time() + -1).'s:3:"efg";'); |
|
173 | 173 | $this->files->shouldReceive('exists')->with( |
174 | 174 | 'path/to/cache/bb/e9/bbe960a25ea311d21d40669e93df2003ba9b90a2' |
175 | 175 | )->andReturnFalse(); |
@@ -186,15 +186,15 @@ discard block |
||
186 | 186 | $ttl = time() + self::DEFAULT_TTL; |
187 | 187 | |
188 | 188 | $this->files->shouldReceive('write') |
189 | - ->with('path/to/cache/0b/ee/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', $ttl . 's:3:"baz";', null, true) |
|
189 | + ->with('path/to/cache/0b/ee/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', $ttl.'s:3:"baz";', null, true) |
|
190 | 190 | ->andReturnTrue(); |
191 | 191 | |
192 | 192 | $this->files->shouldReceive('write') |
193 | - ->with('path/to/cache/62/cd/62cdb7020ff920e5aa642c3d4066950dd1f01f4d', $ttl . 's:3:"foo";', null, true) |
|
193 | + ->with('path/to/cache/62/cd/62cdb7020ff920e5aa642c3d4066950dd1f01f4d', $ttl.'s:3:"foo";', null, true) |
|
194 | 194 | ->andReturnTrue(); |
195 | 195 | |
196 | 196 | $this->files->shouldReceive('write') |
197 | - ->with('path/to/cache/bb/e9/bbe960a25ea311d21d40669e93df2003ba9b90a2', $ttl . 's:3:"bar";', null, true) |
|
197 | + ->with('path/to/cache/bb/e9/bbe960a25ea311d21d40669e93df2003ba9b90a2', $ttl.'s:3:"bar";', null, true) |
|
198 | 198 | ->andReturnTrue(); |
199 | 199 | |
200 | 200 | $this->assertTrue( |
@@ -211,15 +211,15 @@ discard block |
||
211 | 211 | $ttl = time() + 30; |
212 | 212 | |
213 | 213 | $this->files->shouldReceive('write') |
214 | - ->with('path/to/cache/0b/ee/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', $ttl . 's:3:"baz";', null, true) |
|
214 | + ->with('path/to/cache/0b/ee/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', $ttl.'s:3:"baz";', null, true) |
|
215 | 215 | ->andReturnTrue(); |
216 | 216 | |
217 | 217 | $this->files->shouldReceive('write') |
218 | - ->with('path/to/cache/62/cd/62cdb7020ff920e5aa642c3d4066950dd1f01f4d', $ttl . 's:3:"foo";', null, true) |
|
218 | + ->with('path/to/cache/62/cd/62cdb7020ff920e5aa642c3d4066950dd1f01f4d', $ttl.'s:3:"foo";', null, true) |
|
219 | 219 | ->andReturnTrue(); |
220 | 220 | |
221 | 221 | $this->files->shouldReceive('write') |
222 | - ->with('path/to/cache/bb/e9/bbe960a25ea311d21d40669e93df2003ba9b90a2', $ttl . 's:3:"bar";', null, true) |
|
222 | + ->with('path/to/cache/bb/e9/bbe960a25ea311d21d40669e93df2003ba9b90a2', $ttl.'s:3:"bar";', null, true) |
|
223 | 223 | ->andReturnTrue(); |
224 | 224 | |
225 | 225 | $this->assertTrue( |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | public function patch(array $config): array |
27 | 27 | { |
28 | - foreach ($this->patches as $patch) { |
|
28 | + foreach ($this->patches as $patch){ |
|
29 | 29 | $config = $patch->patch($config); |
30 | 30 | } |
31 | 31 |
@@ -25,7 +25,8 @@ |
||
25 | 25 | |
26 | 26 | public function patch(array $config): array |
27 | 27 | { |
28 | - foreach ($this->patches as $patch) { |
|
28 | + foreach ($this->patches as $patch) |
|
29 | + { |
|
29 | 30 | $config = $patch->patch($config); |
30 | 31 | } |
31 | 32 |
@@ -40,10 +40,13 @@ |
||
40 | 40 | |
41 | 41 | public function patch(array $config): array |
42 | 42 | { |
43 | - try { |
|
43 | + try |
|
44 | + { |
|
44 | 45 | $target = &$this->dotGet($config, $this->key); |
45 | 46 | $target = $this->value; |
46 | - } catch (DotNotFoundException $e) { |
|
47 | + } |
|
48 | + catch (DotNotFoundException $e) |
|
49 | + { |
|
47 | 50 | throw new PatchException($e->getMessage(), $e->getCode(), $e); |
48 | 51 | } |
49 | 52 |
@@ -19,15 +19,15 @@ |
||
19 | 19 | public function __construct( |
20 | 20 | private string $key, |
21 | 21 | private mixed $value |
22 | - ) { |
|
22 | + ){ |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | public function patch(array $config): array |
26 | 26 | { |
27 | - try { |
|
27 | + try{ |
|
28 | 28 | $target = &$this->dotGet($config, $this->key); |
29 | 29 | $target = $this->value; |
30 | - } catch (DotNotFoundException $e) { |
|
30 | + }catch (DotNotFoundException $e){ |
|
31 | 31 | throw new PatchException($e->getMessage(), $e->getCode(), $e); |
32 | 32 | } |
33 | 33 |
@@ -13,11 +13,11 @@ |
||
13 | 13 | |
14 | 14 | class UnionTypes |
15 | 15 | { |
16 | - public static function example(SampleClass|TypedClass $example) |
|
16 | + public static function example(SampleClass | TypedClass $example) |
|
17 | 17 | { |
18 | 18 | } |
19 | 19 | |
20 | - public static function unionNull(null|string $nullable): null|string |
|
20 | + public static function unionNull(null | string $nullable): null | string |
|
21 | 21 | { |
22 | 22 | return $nullable; |
23 | 23 | } |
@@ -91,11 +91,13 @@ discard block |
||
91 | 91 | |
92 | 92 | protected function coreHandler(ContainerInterface $container): CoreHandler |
93 | 93 | { |
94 | - if ($this->handler !== null) { |
|
94 | + if ($this->handler !== null) |
|
95 | + { |
|
95 | 96 | return $this->handler; |
96 | 97 | } |
97 | 98 | |
98 | - try { |
|
99 | + try |
|
100 | + { |
|
99 | 101 | // construct on demand |
100 | 102 | $this->handler = new CoreHandler( |
101 | 103 | $this->core ?? $container->get(CoreInterface::class), |
@@ -104,7 +106,9 @@ discard block |
||
104 | 106 | ); |
105 | 107 | |
106 | 108 | return $this->handler; |
107 | - } catch (ContainerExceptionInterface $e) { |
|
109 | + } |
|
110 | + catch (ContainerExceptionInterface $e) |
|
111 | + { |
|
108 | 112 | throw new TargetException($e->getMessage(), $e->getCode(), $e); |
109 | 113 | } |
110 | 114 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | private array $constrains, |
29 | 29 | int $options = 0, |
30 | 30 | private string $defaultAction = 'index' |
31 | - ) { |
|
31 | + ){ |
|
32 | 32 | $this->verbActions = ($options & self::RESTFUL) === self::RESTFUL; |
33 | 33 | } |
34 | 34 | |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | |
63 | 63 | protected function coreHandler(ContainerInterface $container): CoreHandler |
64 | 64 | { |
65 | - if ($this->handler !== null) { |
|
65 | + if ($this->handler !== null){ |
|
66 | 66 | return $this->handler; |
67 | 67 | } |
68 | 68 | |
69 | - try { |
|
69 | + try{ |
|
70 | 70 | // construct on demand |
71 | 71 | $this->handler = new CoreHandler( |
72 | 72 | $this->core ?? $container->get(CoreInterface::class), |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | ); |
76 | 76 | |
77 | 77 | return $this->handler; |
78 | - } catch (ContainerExceptionInterface $e) { |
|
78 | + }catch (ContainerExceptionInterface $e){ |
|
79 | 79 | throw new TargetException($e->getMessage(), $e->getCode(), $e); |
80 | 80 | } |
81 | 81 | } |
@@ -33,7 +33,8 @@ |
||
33 | 33 | |
34 | 34 | public function is(array $type): bool |
35 | 35 | { |
36 | - if ($this->type === null) { |
|
36 | + if ($this->type === null) |
|
37 | + { |
|
37 | 38 | return false; |
38 | 39 | } |
39 | 40 |
@@ -12,12 +12,12 @@ |
||
12 | 12 | public function __construct( |
13 | 13 | public string $value, |
14 | 14 | public ?string $type = null |
15 | - ) { |
|
15 | + ){ |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | public function is(array $type): bool |
19 | 19 | { |
20 | - if ($this->type === null) { |
|
20 | + if ($this->type === null){ |
|
21 | 21 | return false; |
22 | 22 | } |
23 | 23 |