@@ -46,11 +46,12 @@ public function testConstructWithMiddlewareAssignsGivenMiddleware(): void
4646 $ ref = new ReflectionProperty ($ app , 'handler ' );
4747 $ ref ->setAccessible (true );
4848 $ handler = $ ref ->getValue ($ app );
49+ assert ($ handler instanceof MiddlewareHandler);
4950
50- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
5151 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
5252 $ ref ->setAccessible (true );
5353 $ handlers = $ ref ->getValue ($ handler );
54+ assert (is_array ($ handlers ));
5455
5556 if (PHP_VERSION_ID >= 80100 ) {
5657 $ first = array_shift ($ handlers );
@@ -78,11 +79,12 @@ public function testConstructWithContainerAssignsDefaultHandlersAndContainerForR
7879 $ ref = new ReflectionProperty ($ app , 'handler ' );
7980 $ ref ->setAccessible (true );
8081 $ handler = $ ref ->getValue ($ app );
82+ assert ($ handler instanceof MiddlewareHandler);
8183
82- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
8384 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
8485 $ ref ->setAccessible (true );
8586 $ handlers = $ ref ->getValue ($ handler );
87+ assert (is_array ($ handlers ));
8688
8789 if (PHP_VERSION_ID >= 80100 ) {
8890 $ first = array_shift ($ handlers );
@@ -112,11 +114,12 @@ public function testConstructWithContainerAndMiddlewareClassNameAssignsCallableF
112114 $ ref = new ReflectionProperty ($ app , 'handler ' );
113115 $ ref ->setAccessible (true );
114116 $ handler = $ ref ->getValue ($ app );
117+ assert ($ handler instanceof MiddlewareHandler);
115118
116- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
117119 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
118120 $ ref ->setAccessible (true );
119121 $ handlers = $ ref ->getValue ($ handler );
122+ assert (is_array ($ handlers ));
120123
121124 if (PHP_VERSION_ID >= 80100 ) {
122125 $ first = array_shift ($ handlers );
@@ -144,11 +147,12 @@ public function testConstructWithErrorHandlerOnlyAssignsErrorHandlerAfterDefault
144147 $ ref = new ReflectionProperty ($ app , 'handler ' );
145148 $ ref ->setAccessible (true );
146149 $ handler = $ ref ->getValue ($ app );
150+ assert ($ handler instanceof MiddlewareHandler);
147151
148- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
149152 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
150153 $ ref ->setAccessible (true );
151154 $ handlers = $ ref ->getValue ($ handler );
155+ assert (is_array ($ handlers ));
152156
153157 if (PHP_VERSION_ID >= 80100 ) {
154158 $ first = array_shift ($ handlers );
@@ -168,11 +172,12 @@ public function testConstructWithErrorHandlerClassOnlyAssignsErrorHandlerAfterDe
168172 $ ref = new ReflectionProperty ($ app , 'handler ' );
169173 $ ref ->setAccessible (true );
170174 $ handler = $ ref ->getValue ($ app );
175+ assert ($ handler instanceof MiddlewareHandler);
171176
172- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
173177 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
174178 $ ref ->setAccessible (true );
175179 $ handlers = $ ref ->getValue ($ handler );
180+ assert (is_array ($ handlers ));
176181
177182 if (PHP_VERSION_ID >= 80100 ) {
178183 $ first = array_shift ($ handlers );
@@ -194,11 +199,12 @@ public function testConstructWithContainerAndErrorHandlerAssignsErrorHandlerAfte
194199 $ ref = new ReflectionProperty ($ app , 'handler ' );
195200 $ ref ->setAccessible (true );
196201 $ handler = $ ref ->getValue ($ app );
202+ assert ($ handler instanceof MiddlewareHandler);
197203
198- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
199204 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
200205 $ ref ->setAccessible (true );
201206 $ handlers = $ ref ->getValue ($ handler );
207+ assert (is_array ($ handlers ));
202208
203209 if (PHP_VERSION_ID >= 80100 ) {
204210 $ first = array_shift ($ handlers );
@@ -223,11 +229,12 @@ public function testConstructWithContainerAndErrorHandlerClassAssignsErrorHandle
223229 $ ref = new ReflectionProperty ($ app , 'handler ' );
224230 $ ref ->setAccessible (true );
225231 $ handler = $ ref ->getValue ($ app );
232+ assert ($ handler instanceof MiddlewareHandler);
226233
227- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
228234 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
229235 $ ref ->setAccessible (true );
230236 $ handlers = $ ref ->getValue ($ handler );
237+ assert (is_array ($ handlers ));
231238
232239 if (PHP_VERSION_ID >= 80100 ) {
233240 $ first = array_shift ($ handlers );
@@ -255,11 +262,12 @@ public function testConstructWithMultipleContainersAndErrorHandlerClassAssignsEr
255262 $ ref = new ReflectionProperty ($ app , 'handler ' );
256263 $ ref ->setAccessible (true );
257264 $ handler = $ ref ->getValue ($ app );
265+ assert ($ handler instanceof MiddlewareHandler);
258266
259- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
260267 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
261268 $ ref ->setAccessible (true );
262269 $ handlers = $ ref ->getValue ($ handler );
270+ assert (is_array ($ handlers ));
263271
264272 if (PHP_VERSION_ID >= 80100 ) {
265273 $ first = array_shift ($ handlers );
@@ -288,11 +296,12 @@ public function testConstructWithMultipleContainersAndMiddlewareAssignsErrorHand
288296 $ ref = new ReflectionProperty ($ app , 'handler ' );
289297 $ ref ->setAccessible (true );
290298 $ handler = $ ref ->getValue ($ app );
299+ assert ($ handler instanceof MiddlewareHandler);
291300
292- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
293301 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
294302 $ ref ->setAccessible (true );
295303 $ handlers = $ ref ->getValue ($ handler );
304+ assert (is_array ($ handlers ));
296305
297306 if (PHP_VERSION_ID >= 80100 ) {
298307 $ first = array_shift ($ handlers );
@@ -316,11 +325,12 @@ public function testConstructWithMiddlewareAndErrorHandlerAssignsGivenErrorHandl
316325 $ ref = new ReflectionProperty ($ app , 'handler ' );
317326 $ ref ->setAccessible (true );
318327 $ handler = $ ref ->getValue ($ app );
328+ assert ($ handler instanceof MiddlewareHandler);
319329
320- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
321330 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
322331 $ ref ->setAccessible (true );
323332 $ handlers = $ ref ->getValue ($ handler );
333+ assert (is_array ($ handlers ));
324334
325335 if (PHP_VERSION_ID >= 80100 ) {
326336 $ first = array_shift ($ handlers );
@@ -356,11 +366,12 @@ public function testConstructWithMultipleContainersAndMiddlewareAndErrorHandlerC
356366 $ ref = new ReflectionProperty ($ app , 'handler ' );
357367 $ ref ->setAccessible (true );
358368 $ handler = $ ref ->getValue ($ app );
369+ assert ($ handler instanceof MiddlewareHandler);
359370
360- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
361371 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
362372 $ ref ->setAccessible (true );
363373 $ handlers = $ ref ->getValue ($ handler );
374+ assert (is_array ($ handlers ));
364375
365376 if (PHP_VERSION_ID >= 80100 ) {
366377 $ first = array_shift ($ handlers );
@@ -385,11 +396,12 @@ public function testConstructWithAccessLogHandlerAndErrorHandlerAssignsHandlersA
385396 $ ref = new ReflectionProperty ($ app , 'handler ' );
386397 $ ref ->setAccessible (true );
387398 $ handler = $ ref ->getValue ($ app );
399+ assert ($ handler instanceof MiddlewareHandler);
388400
389- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
390401 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
391402 $ ref ->setAccessible (true );
392403 $ handlers = $ ref ->getValue ($ handler );
404+ assert (is_array ($ handlers ));
393405
394406 if (PHP_VERSION_ID >= 80100 ) {
395407 $ first = array_shift ($ handlers );
@@ -409,11 +421,12 @@ public function testConstructWithAccessLogHandlerClassAndErrorHandlerClassAssign
409421 $ ref = new ReflectionProperty ($ app , 'handler ' );
410422 $ ref ->setAccessible (true );
411423 $ handler = $ ref ->getValue ($ app );
424+ assert ($ handler instanceof MiddlewareHandler);
412425
413- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
414426 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
415427 $ ref ->setAccessible (true );
416428 $ handlers = $ ref ->getValue ($ handler );
429+ assert (is_array ($ handlers ));
417430
418431 if (PHP_VERSION_ID >= 80100 ) {
419432 $ first = array_shift ($ handlers );
@@ -440,11 +453,12 @@ public function testConstructWithContainerAndAccessLogHandlerClassAndErrorHandle
440453 $ ref = new ReflectionProperty ($ app , 'handler ' );
441454 $ ref ->setAccessible (true );
442455 $ handler = $ ref ->getValue ($ app );
456+ assert ($ handler instanceof MiddlewareHandler);
443457
444- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
445458 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
446459 $ ref ->setAccessible (true );
447460 $ handlers = $ ref ->getValue ($ handler );
461+ assert (is_array ($ handlers ));
448462
449463 if (PHP_VERSION_ID >= 80100 ) {
450464 $ first = array_shift ($ handlers );
@@ -468,11 +482,12 @@ public function testConstructWithMiddlewareBeforeAccessLogHandlerAndErrorHandler
468482 $ ref = new ReflectionProperty ($ app , 'handler ' );
469483 $ ref ->setAccessible (true );
470484 $ handler = $ ref ->getValue ($ app );
485+ assert ($ handler instanceof MiddlewareHandler);
471486
472- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
473487 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
474488 $ ref ->setAccessible (true );
475489 $ handlers = $ ref ->getValue ($ handler );
490+ assert (is_array ($ handlers ));
476491
477492 if (PHP_VERSION_ID >= 80100 ) {
478493 $ first = array_shift ($ handlers );
@@ -505,11 +520,12 @@ public function testConstructWithMultipleContainersAndAccessLogHandlerClassAndEr
505520 $ ref = new ReflectionProperty ($ app , 'handler ' );
506521 $ ref ->setAccessible (true );
507522 $ handler = $ ref ->getValue ($ app );
523+ assert ($ handler instanceof MiddlewareHandler);
508524
509- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
510525 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
511526 $ ref ->setAccessible (true );
512527 $ handlers = $ ref ->getValue ($ handler );
528+ assert (is_array ($ handlers ));
513529
514530 if (PHP_VERSION_ID >= 80100 ) {
515531 $ first = array_shift ($ handlers );
@@ -543,11 +559,12 @@ public function testConstructWithMultipleContainersAndMiddlewareAssignsDefaultHa
543559 $ ref = new ReflectionProperty ($ app , 'handler ' );
544560 $ ref ->setAccessible (true );
545561 $ handler = $ ref ->getValue ($ app );
562+ assert ($ handler instanceof MiddlewareHandler);
546563
547- $ this ->assertInstanceOf (MiddlewareHandler::class, $ handler );
548564 $ ref = new ReflectionProperty ($ handler , 'handlers ' );
549565 $ ref ->setAccessible (true );
550566 $ handlers = $ ref ->getValue ($ handler );
567+ assert (is_array ($ handlers ));
551568
552569 if (PHP_VERSION_ID >= 80100 ) {
553570 $ first = array_shift ($ handlers );
@@ -1458,6 +1475,7 @@ public function testHandleRequestWithMatchingRouteAndRouteVariablesReturnsRespon
14581475
14591476 $ app ->get ('/users/{name} ' , function (ServerRequestInterface $ request ) {
14601477 $ name = $ request ->getAttribute ('name ' );
1478+ assert (is_string ($ name ));
14611479
14621480 return new Response (
14631481 200 ,
@@ -2091,10 +2109,12 @@ private function createAppWithoutLogger(): App
20912109 $ ref = new \ReflectionProperty ($ app , 'handler ' );
20922110 $ ref ->setAccessible (true );
20932111 $ middleware = $ ref ->getValue ($ app );
2112+ assert ($ middleware instanceof MiddlewareHandler);
20942113
20952114 $ ref = new \ReflectionProperty ($ middleware , 'handlers ' );
20962115 $ ref ->setAccessible (true );
20972116 $ handlers = $ ref ->getValue ($ middleware );
2117+ assert (is_array ($ handlers ));
20982118
20992119 if (PHP_VERSION_ID >= 80100 ) {
21002120 $ first = array_shift ($ handlers );
0 commit comments