@@ -47,7 +47,7 @@ public function testRunHandler(): void
47
47
{
48
48
$ core = $ this ->getCore ();
49
49
50
- $ core ->setHandler (fn () => 'hello world ' );
50
+ $ core ->setHandler (fn (): string => 'hello world ' );
51
51
52
52
$ response = $ core ->handle (new ServerRequest ('GET ' , '' ));
53
53
$ this ->assertSame ('hello world ' , (string )$ response ->getBody ());
@@ -67,7 +67,7 @@ public function testHandlerInterface(): void
67
67
{
68
68
$ core = $ this ->getCore ();
69
69
$ core ->setHandler (
70
- new CallableHandler (fn () => 'hello world ' , new ResponseFactory (new HttpConfig (['headers ' => []])))
70
+ new CallableHandler (fn (): string => 'hello world ' , new ResponseFactory (new HttpConfig (['headers ' => []])))
71
71
);
72
72
73
73
$ response = $ core ->handle (new ServerRequest ('GET ' , '' ));
@@ -143,7 +143,7 @@ public function testJson(): void
143
143
{
144
144
$ core = $ this ->getCore ();
145
145
146
- $ core ->setHandler (fn () => [
146
+ $ core ->setHandler (fn (): array => [
147
147
'status ' => 404 ,
148
148
'message ' => 'not found ' ,
149
149
]);
@@ -157,7 +157,7 @@ public function testJsonSerializable(): void
157
157
{
158
158
$ core = $ this ->getCore ();
159
159
160
- $ core ->setHandler (fn () => new Json ([
160
+ $ core ->setHandler (fn (): Json => new Json ([
161
161
'status ' => 404 ,
162
162
'message ' => 'not found ' ,
163
163
]));
@@ -171,7 +171,7 @@ public function testMiddleware(): void
171
171
{
172
172
$ core = $ this ->getCore ([HeaderMiddleware::class]);
173
173
174
- $ core ->setHandler (fn () => 'hello? ' );
174
+ $ core ->setHandler (fn (): string => 'hello? ' );
175
175
176
176
$ response = $ core ->handle (new ServerRequest ('GET ' , '' ));
177
177
$ this ->assertSame (['text/html; charset=UTF-8 ' ], $ response ->getHeader ('Content-Type ' ));
@@ -186,7 +186,7 @@ public function testMiddlewareTrait(): void
186
186
$ core ->getPipeline ()->pushMiddleware (new Header2Middleware ());
187
187
$ core ->getPipeline ()->riseMiddleware (new HeaderMiddleware ());
188
188
189
- $ core ->setHandler (fn () => 'hello? ' );
189
+ $ core ->setHandler (fn (): string => 'hello? ' );
190
190
191
191
$ response = $ core ->handle (new ServerRequest ('GET ' , '' ));
192
192
$ this ->assertSame (['text/html; charset=UTF-8 ' ], $ response ->getHeader ('Content-Type ' ));
@@ -201,7 +201,7 @@ public function testMiddlewareTraitReversed(): void
201
201
$ core ->getPipeline ()->pushMiddleware (new HeaderMiddleware ());
202
202
$ core ->getPipeline ()->riseMiddleware (new Header2Middleware ());
203
203
204
- $ core ->setHandler (fn () => 'hello? ' );
204
+ $ core ->setHandler (fn (): string => 'hello? ' );
205
205
206
206
$ response = $ core ->handle (new ServerRequest ('GET ' , '' ));
207
207
$ this ->assertSame (['text/html; charset=UTF-8 ' ], $ response ->getHeader ('Content-Type ' ));
@@ -237,7 +237,7 @@ public function testEventsShouldBeDispatched(): void
237
237
238
238
$ core = $ this ->getCore ();
239
239
240
- $ core ->setHandler (fn () => 'hello world ' );
240
+ $ core ->setHandler (fn (): string => 'hello world ' );
241
241
242
242
$ response = $ core ->handle ($ request );
243
243
$ this ->assertSame ('hello world ' , (string )$ response ->getBody ());
@@ -256,7 +256,7 @@ public function testPassingTracerIntoScope(): void
256
256
$ tracerFactory = m::mock (TracerFactoryInterface::class),
257
257
);
258
258
259
- $ http ->setHandler (fn () => 'hello world ' );
259
+ $ http ->setHandler (fn (): string => 'hello world ' );
260
260
261
261
$ tracerFactory
262
262
->shouldReceive ('make ' )
@@ -319,7 +319,7 @@ function ($name, $callback, $attributes, $scoped, $traceKind) {
319
319
$ tracerFactory ,
320
320
);
321
321
322
- $ http ->setHandler (fn () => 'hello world ' );
322
+ $ http ->setHandler (fn (): string => 'hello world ' );
323
323
324
324
$ response = $ http ->handle ($ request );
325
325
$ this ->assertSame ('hello world ' , (string )$ response ->getBody ());
@@ -338,7 +338,7 @@ public function testTraceContextIsAppliedToResponse(): void
338
338
$ tracerFactory = m::mock (TracerFactoryInterface::class),
339
339
);
340
340
341
- $ http ->setHandler (fn () => 'hello world ' );
341
+ $ http ->setHandler (fn (): string => 'hello world ' );
342
342
343
343
$ tracerFactory
344
344
->shouldReceive ('make ' )
0 commit comments