File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -394,10 +394,11 @@ public function __destruct()
394394 /**
395395 * fetch the current routing table, if the message specification allows it.
396396 *
397- * @param array $routing
397+ * @param array|null $routing
398+ *
398399 * @return array|null
399400 */
400- public function route (array $ routing ): ?array
401+ public function route (? array $ routing = null ): ?array
401402 {
402403 if (!method_exists ($ this ->protocol , 'route ' )) {
403404 return null ;
Original file line number Diff line number Diff line change 1616 */
1717class V4_3 extends V4_1
1818{
19- public function route (array $ routing ): array
19+ public function route (? array $ routing = null ): array
2020 {
21- $ this ->write ($ this ->packer ->pack (0x66 , $ routing ));
21+ $ this ->write ($ this ->packer ->pack (0x66 , $ routing ?? [] ));
2222
2323 $ signature = 0 ;
2424 $ output = $ this ->read ($ signature );
Original file line number Diff line number Diff line change @@ -29,4 +29,14 @@ public function test__construct()
2929 return $ cls ;
3030 }
3131
32+ /**
33+ * @return V4_3
34+ */
35+ public function testRoute (): void
36+ {
37+ $ v4_3 = $ this ->test__construct ();
38+
39+ self ::assertEquals ([], $ v4_3 ->route ());
40+ }
41+
3242}
You can’t perform that action at this time.
0 commit comments