File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,10 @@ public function __construct(
2121
2222 /**
2323 * @link https://redis.io/commands/lindex
24+ *
25+ * TODO: Change type declaration to int only in next major.
2426 */
25- public function get (string $ index ): string
27+ public function get (string | int $ index ): ? string
2628 {
2729 return $ this ->client ->execute ('lindex ' , $ this ->key , $ index );
2830 }
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ public function test(): void
5151 $ this ->assertSame ('y ' , $ list ->popHeadBlocking ());
5252 $ this ->assertSame ('b ' , $ list ->popTailBlocking ());
5353
54+ $ this ->assertNull ($ this ->redis ->getList ('nonexistent ' )->get (0 ));
5455 $ this ->assertNull ($ this ->redis ->getList ('nonexistent ' )->popHeadBlocking (1 ));
5556 $ this ->assertNull ($ this ->redis ->getList ('nonexistent ' )->popTailBlocking (1 ));
5657 $ this ->assertNull ($ this ->redis ->getList ('nonexistent ' )->popTailPushHeadBlocking ('nonexistent ' , 1 ));
You can’t perform that action at this time.
0 commit comments