File tree Expand file tree Collapse file tree 3 files changed +13
-15
lines changed Expand file tree Collapse file tree 3 files changed +13
-15
lines changed Original file line number Diff line number Diff line change 1717use Hyperf \AsyncQueue \Message ;
1818use Hyperf \AsyncQueue \MessageInterface ;
1919use Hyperf \Redis \RedisFactory ;
20+ use Hyperf \Redis \RedisProxy ;
2021use Psr \Container \ContainerInterface ;
2122
2223class RedisDriver extends Driver
2324{
24- /**
25- * @var \Redis
26- */
27- protected $ redis ;
25+ protected RedisProxy $ redis ;
2826
29- /**
30- * @var ChannelConfig
31- */
32- protected $ channel ;
27+ protected ChannelConfig $ channel ;
3328
3429 /**
3530 * Max polling time.
36- * @var int
3731 */
38- protected $ timeout ;
32+ protected int $ timeout ;
3933
4034 /**
4135 * Retry delay time.
42- * @var array|int
4336 */
44- protected $ retrySeconds ;
37+ protected array | int $ retrySeconds ;
4538
4639 /**
4740 * Handle timeout.
48- * @var int
4941 */
50- protected $ handleTimeout ;
42+ protected int $ handleTimeout ;
5143
5244 public function __construct (ContainerInterface $ container , $ config )
5345 {
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ protected function getContainer()
5555 $ container = Mockery::mock (Container::class);
5656 $ container ->shouldReceive ('has ' )->andReturn (false );
5757 $ container ->shouldReceive ('get ' )->with (\Redis::class)->andReturn (new Redis ());
58+ $ container ->shouldReceive ('get ' )->with (Redis::class)->andReturn (new Redis ());
5859 $ container ->shouldReceive ('get ' )->with (PhpSerializerPacker::class)->andReturn (new PhpSerializerPacker ());
5960 $ container ->shouldReceive ('get ' )->with (EventDispatcherInterface::class)->andReturn (null );
6061 $ container ->shouldReceive ('make ' )->with (ChannelConfig::class, Mockery::any ())->andReturnUsing (function ($ class , $ args ) {
Original file line number Diff line number Diff line change 1111 */
1212namespace HyperfTest \AsyncQueue \Stub ;
1313
14+ use Hyperf \Redis \RedisProxy ;
1415use Hyperf \Utils \Context ;
1516
16- class Redis
17+ class Redis extends RedisProxy
1718{
19+ public function __construct ()
20+ {
21+ }
22+
1823 public function lPush ($ key , ...$ values )
1924 {
2025 Context::set ('test.async-queue.lpush.key ' , $ key );
You can’t perform that action at this time.
0 commit comments