@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | class ConfigureTest extends BaseTest |
25 | 25 | { |
26 | 26 | public const TOKENIZER_CONFIG = [ |
27 | - 'directories' => [__DIR__ . '/../src/Command', __DIR__ . '/Fixtures/'], |
|
27 | + 'directories' => [__DIR__.'/../src/Command', __DIR__.'/Fixtures/'], |
|
28 | 28 | 'exclude' => [] |
29 | 29 | ]; |
30 | 30 | |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | ['command' => 'test', 'header' => 'Test Command'], |
35 | 35 | ['command' => 'helper', 'options' => ['helper' => 'writeln'], 'footer' => 'Good!'], |
36 | 36 | ['invoke' => [self::class, 'do']], |
37 | - ['invoke' => self::class . '::do'], |
|
37 | + ['invoke' => self::class.'::do'], |
|
38 | 38 | 'Spiral\Tests\Console\ok', |
39 | - ['invoke' => self::class . '::err'], |
|
39 | + ['invoke' => self::class.'::err'], |
|
40 | 40 | ] |
41 | 41 | ]; |
42 | 42 |
@@ -126,10 +126,12 @@ |
||
126 | 126 | $this->assertEquals(1, $output->getCode()); |
127 | 127 | } |
128 | 128 | |
129 | - public function do(OutputInterface $output): void |
|
129 | + public function do{ |
|
130 | + (OutputInterface $output): void |
|
130 | 131 | { |
131 | 132 | $output->write('OK'); |
132 | 133 | } |
134 | + } |
|
133 | 135 | |
134 | 136 | public function err(OutputInterface $output): void |
135 | 137 | { |
@@ -21,7 +21,7 @@ |
||
21 | 21 | abstract class BaseTest extends TestCase |
22 | 22 | { |
23 | 23 | public const TOKENIZER_CONFIG = [ |
24 | - 'directories' => [__DIR__ . '/Fixtures/'], |
|
24 | + 'directories' => [__DIR__.'/Fixtures/'], |
|
25 | 25 | 'exclude' => ['User'], |
26 | 26 | ]; |
27 | 27 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | class UpdateTest extends BaseTest |
25 | 25 | { |
26 | 26 | public const TOKENIZER_CONFIG = [ |
27 | - 'directories' => [__DIR__ . '/../src/Command', __DIR__ . '/Fixtures/'], |
|
27 | + 'directories' => [__DIR__.'/../src/Command', __DIR__.'/Fixtures/'], |
|
28 | 28 | 'exclude' => [] |
29 | 29 | ]; |
30 | 30 | |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | ['command' => 'test', 'header' => 'Test Command'], |
36 | 36 | ['command' => 'helper', 'options' => ['helper' => 'writeln'], 'footer' => 'Good!'], |
37 | 37 | ['invoke' => [self::class, 'do']], |
38 | - ['invoke' => self::class . '::do'], |
|
38 | + ['invoke' => self::class.'::do'], |
|
39 | 39 | 'Spiral\Tests\Console\ok', |
40 | - ['invoke' => self::class . '::err'], |
|
40 | + ['invoke' => self::class.'::err'], |
|
41 | 41 | ] |
42 | 42 | ]; |
43 | 43 |
@@ -126,10 +126,12 @@ |
||
126 | 126 | $this->assertEquals(1, $output->getCode()); |
127 | 127 | } |
128 | 128 | |
129 | - public function do(OutputInterface $output): void |
|
129 | + public function do{ |
|
130 | + (OutputInterface $output): void |
|
130 | 131 | { |
131 | 132 | $output->write('OK'); |
132 | 133 | } |
134 | + } |
|
133 | 135 | |
134 | 136 | public function err(OutputInterface $output): void |
135 | 137 | { |
@@ -22,6 +22,6 @@ |
||
22 | 22 | */ |
23 | 23 | public function perform(): void |
24 | 24 | { |
25 | - throw new Exception('Unhandled another failed command error at ' . __METHOD__ . ' (line ' . __LINE__ . ')'); |
|
25 | + throw new Exception('Unhandled another failed command error at '.__METHOD__.' (line '.__LINE__.')'); |
|
26 | 26 | } |
27 | 27 | } |
@@ -22,6 +22,6 @@ |
||
22 | 22 | */ |
23 | 23 | public function perform(): void |
24 | 24 | { |
25 | - throw new Exception('Unhandled failed command error at ' . __METHOD__ . ' (line ' . __LINE__ . ')'); |
|
25 | + throw new Exception('Unhandled failed command error at '.__METHOD__.' (line '.__LINE__.')'); |
|
26 | 26 | } |
27 | 27 | } |
@@ -22,6 +22,6 @@ |
||
22 | 22 | |
23 | 23 | public function perform(): void |
24 | 24 | { |
25 | - $this->write('Hello World - ' . ($this->count++)); |
|
25 | + $this->write('Hello World - '.($this->count++)); |
|
26 | 26 | } |
27 | 27 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | |
27 | 27 | public function perform(): void |
28 | 28 | { |
29 | - switch ($this->argument('helper')) { |
|
29 | + switch ($this->argument('helper')){ |
|
30 | 30 | case 'verbose': |
31 | 31 | $this->write($this->isVerbose() ? 'true' : 'false'); |
32 | 32 | break; |
@@ -26,7 +26,8 @@ |
||
26 | 26 | |
27 | 27 | public function perform(): void |
28 | 28 | { |
29 | - switch ($this->argument('helper')) { |
|
29 | + switch ($this->argument('helper')) |
|
30 | + { |
|
30 | 31 | case 'verbose': |
31 | 32 | $this->write($this->isVerbose() ? 'true' : 'false'); |
32 | 33 | break; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $headers = $acceptHeader->getAll(); |
119 | 119 | $this->assertCount(count($expected), $headers); |
120 | 120 | |
121 | - foreach ($expected as $i => $value) { |
|
121 | + foreach ($expected as $i => $value){ |
|
122 | 122 | $this->assertSame($value, $headers[$i]->getValue()); |
123 | 123 | } |
124 | 124 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $headers = $acceptHeader->getAll(); |
165 | 165 | $this->assertCount(count($expected), $headers); |
166 | 166 | |
167 | - foreach ($expected as $i => $value) { |
|
167 | + foreach ($expected as $i => $value){ |
|
168 | 168 | $this->assertSame($value, (string)$headers[$i]); |
169 | 169 | } |
170 | 170 | } |
@@ -118,7 +118,8 @@ discard block |
||
118 | 118 | $headers = $acceptHeader->getAll(); |
119 | 119 | $this->assertCount(count($expected), $headers); |
120 | 120 | |
121 | - foreach ($expected as $i => $value) { |
|
121 | + foreach ($expected as $i => $value) |
|
122 | + { |
|
122 | 123 | $this->assertSame($value, $headers[$i]->getValue()); |
123 | 124 | } |
124 | 125 | } |
@@ -164,7 +165,8 @@ discard block |
||
164 | 165 | $headers = $acceptHeader->getAll(); |
165 | 166 | $this->assertCount(count($expected), $headers); |
166 | 167 | |
167 | - foreach ($expected as $i => $value) { |
|
168 | + foreach ($expected as $i => $value) |
|
169 | + { |
|
168 | 170 | $this->assertSame($value, (string)$headers[$i]); |
169 | 171 | } |
170 | 172 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | { |
45 | 45 | $core = $this->getCore(); |
46 | 46 | |
47 | - $core->setHandler(function () { |
|
47 | + $core->setHandler(function (){ |
|
48 | 48 | return 'hello world'; |
49 | 49 | }); |
50 | 50 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | public function testHandlerInterface(): void |
74 | 74 | { |
75 | 75 | $core = $this->getCore(); |
76 | - $core->setHandler(new CallableHandler(function () { |
|
76 | + $core->setHandler(new CallableHandler(function (){ |
|
77 | 77 | return 'hello world'; |
78 | 78 | }, new ResponseFactory(new HttpConfig(['headers' => []])))); |
79 | 79 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | { |
86 | 86 | $core = $this->getCore(); |
87 | 87 | |
88 | - $core->setHandler(function ($req, $resp) { |
|
88 | + $core->setHandler(function ($req, $resp){ |
|
89 | 89 | return $resp->withAddedHeader('hello', 'value'); |
90 | 90 | }); |
91 | 91 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | $core = $this->getCore(); |
100 | 100 | |
101 | - $core->setHandler(function ($req, $resp) { |
|
101 | + $core->setHandler(function ($req, $resp){ |
|
102 | 102 | echo 'hello!'; |
103 | 103 | |
104 | 104 | return $resp->withAddedHeader('hello', 'value'); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | { |
115 | 115 | $core = $this->getCore(); |
116 | 116 | |
117 | - $core->setHandler(function ($req, $resp) { |
|
117 | + $core->setHandler(function ($req, $resp){ |
|
118 | 118 | echo 'hello!'; |
119 | 119 | $resp->getBody()->write('world '); |
120 | 120 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | { |
132 | 132 | $core = $this->getCore(); |
133 | 133 | |
134 | - $core->setHandler(function () { |
|
134 | + $core->setHandler(function (){ |
|
135 | 135 | ob_start(); |
136 | 136 | ob_start(); |
137 | 137 | echo 'hello!'; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | { |
153 | 153 | $core = $this->getCore(); |
154 | 154 | |
155 | - $core->setHandler(function () { |
|
155 | + $core->setHandler(function (){ |
|
156 | 156 | return [ |
157 | 157 | 'status' => 404, |
158 | 158 | 'message' => 'not found', |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | { |
169 | 169 | $core = $this->getCore(); |
170 | 170 | |
171 | - $core->setHandler(function () { |
|
171 | + $core->setHandler(function (){ |
|
172 | 172 | return new Json([ |
173 | 173 | 'status' => 404, |
174 | 174 | 'message' => 'not found', |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | { |
185 | 185 | $core = $this->getCore([HeaderMiddleware::class]); |
186 | 186 | |
187 | - $core->setHandler(function () { |
|
187 | + $core->setHandler(function (){ |
|
188 | 188 | return 'hello?'; |
189 | 189 | }); |
190 | 190 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $core->getPipeline()->pushMiddleware(new Header2Middleware()); |
202 | 202 | $core->getPipeline()->riseMiddleware(new HeaderMiddleware()); |
203 | 203 | |
204 | - $core->setHandler(function () { |
|
204 | + $core->setHandler(function (){ |
|
205 | 205 | return 'hello?'; |
206 | 206 | }); |
207 | 207 | |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $core->getPipeline()->pushMiddleware(new HeaderMiddleware()); |
219 | 219 | $core->getPipeline()->riseMiddleware(new Header2Middleware()); |
220 | 220 | |
221 | - $core->setHandler(function () { |
|
221 | + $core->setHandler(function (){ |
|
222 | 222 | return 'hello?'; |
223 | 223 | }); |
224 | 224 | |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | { |
233 | 233 | $core = $this->getCore(); |
234 | 234 | |
235 | - $core->setHandler(function () { |
|
235 | + $core->setHandler(function (){ |
|
236 | 236 | $this->assertTrue($this->container->has(ServerRequestInterface::class)); |
237 | 237 | |
238 | 238 | return 'OK'; |
@@ -44,7 +44,8 @@ discard block |
||
44 | 44 | { |
45 | 45 | $core = $this->getCore(); |
46 | 46 | |
47 | - $core->setHandler(function () { |
|
47 | + $core->setHandler(function () |
|
48 | + { |
|
48 | 49 | return 'hello world'; |
49 | 50 | }); |
50 | 51 | |
@@ -73,7 +74,8 @@ discard block |
||
73 | 74 | public function testHandlerInterface(): void |
74 | 75 | { |
75 | 76 | $core = $this->getCore(); |
76 | - $core->setHandler(new CallableHandler(function () { |
|
77 | + $core->setHandler(new CallableHandler(function () |
|
78 | + { |
|
77 | 79 | return 'hello world'; |
78 | 80 | }, new ResponseFactory(new HttpConfig(['headers' => []])))); |
79 | 81 | |
@@ -85,7 +87,8 @@ discard block |
||
85 | 87 | { |
86 | 88 | $core = $this->getCore(); |
87 | 89 | |
88 | - $core->setHandler(function ($req, $resp) { |
|
90 | + $core->setHandler(function ($req, $resp) |
|
91 | + { |
|
89 | 92 | return $resp->withAddedHeader('hello', 'value'); |
90 | 93 | }); |
91 | 94 | |
@@ -98,7 +101,8 @@ discard block |
||
98 | 101 | { |
99 | 102 | $core = $this->getCore(); |
100 | 103 | |
101 | - $core->setHandler(function ($req, $resp) { |
|
104 | + $core->setHandler(function ($req, $resp) |
|
105 | + { |
|
102 | 106 | echo 'hello!'; |
103 | 107 | |
104 | 108 | return $resp->withAddedHeader('hello', 'value'); |
@@ -114,7 +118,8 @@ discard block |
||
114 | 118 | { |
115 | 119 | $core = $this->getCore(); |
116 | 120 | |
117 | - $core->setHandler(function ($req, $resp) { |
|
121 | + $core->setHandler(function ($req, $resp) |
|
122 | + { |
|
118 | 123 | echo 'hello!'; |
119 | 124 | $resp->getBody()->write('world '); |
120 | 125 | |
@@ -131,7 +136,8 @@ discard block |
||
131 | 136 | { |
132 | 137 | $core = $this->getCore(); |
133 | 138 | |
134 | - $core->setHandler(function () { |
|
139 | + $core->setHandler(function () |
|
140 | + { |
|
135 | 141 | ob_start(); |
136 | 142 | ob_start(); |
137 | 143 | echo 'hello!'; |
@@ -152,7 +158,8 @@ discard block |
||
152 | 158 | { |
153 | 159 | $core = $this->getCore(); |
154 | 160 | |
155 | - $core->setHandler(function () { |
|
161 | + $core->setHandler(function () |
|
162 | + { |
|
156 | 163 | return [ |
157 | 164 | 'status' => 404, |
158 | 165 | 'message' => 'not found', |
@@ -168,7 +175,8 @@ discard block |
||
168 | 175 | { |
169 | 176 | $core = $this->getCore(); |
170 | 177 | |
171 | - $core->setHandler(function () { |
|
178 | + $core->setHandler(function () |
|
179 | + { |
|
172 | 180 | return new Json([ |
173 | 181 | 'status' => 404, |
174 | 182 | 'message' => 'not found', |
@@ -184,7 +192,8 @@ discard block |
||
184 | 192 | { |
185 | 193 | $core = $this->getCore([HeaderMiddleware::class]); |
186 | 194 | |
187 | - $core->setHandler(function () { |
|
195 | + $core->setHandler(function () |
|
196 | + { |
|
188 | 197 | return 'hello?'; |
189 | 198 | }); |
190 | 199 | |
@@ -201,7 +210,8 @@ discard block |
||
201 | 210 | $core->getPipeline()->pushMiddleware(new Header2Middleware()); |
202 | 211 | $core->getPipeline()->riseMiddleware(new HeaderMiddleware()); |
203 | 212 | |
204 | - $core->setHandler(function () { |
|
213 | + $core->setHandler(function () |
|
214 | + { |
|
205 | 215 | return 'hello?'; |
206 | 216 | }); |
207 | 217 | |
@@ -218,7 +228,8 @@ discard block |
||
218 | 228 | $core->getPipeline()->pushMiddleware(new HeaderMiddleware()); |
219 | 229 | $core->getPipeline()->riseMiddleware(new Header2Middleware()); |
220 | 230 | |
221 | - $core->setHandler(function () { |
|
231 | + $core->setHandler(function () |
|
232 | + { |
|
222 | 233 | return 'hello?'; |
223 | 234 | }); |
224 | 235 | |
@@ -232,7 +243,8 @@ discard block |
||
232 | 243 | { |
233 | 244 | $core = $this->getCore(); |
234 | 245 | |
235 | - $core->setHandler(function () { |
|
246 | + $core->setHandler(function () |
|
247 | + { |
|
236 | 248 | $this->assertTrue($this->container->has(ServerRequestInterface::class)); |
237 | 249 | |
238 | 250 | return 'OK'; |