File tree Expand file tree Collapse file tree 3 files changed +21
-18
lines changed Expand file tree Collapse file tree 3 files changed +21
-18
lines changed Original file line number Diff line number Diff line change 1414
1515use Hyperf \AsyncQueue \Driver \DriverFactory ;
1616use Hyperf \Framework \Annotation \Command ;
17+ use Psr \Container \ContainerInterface ;
1718use Symfony \Component \Console \Command \Command as SymfonyCommand ;
1819use Symfony \Component \Console \Input \InputArgument ;
1920use Symfony \Component \Console \Input \InputInterface ;
2526class FlushFailedMessageCommand extends SymfonyCommand
2627{
2728 /**
28- * @var DriverFactory
29+ * @var ContainerInterface
2930 */
30- protected $ factory ;
31+ protected $ container ;
3132
32- public function __construct (DriverFactory $ factory )
33+ public function __construct (ContainerInterface $ container )
3334 {
34- $ this ->factory = $ factory ;
35+ $ this ->container = $ container ;
3536 parent ::__construct ('queue:flush ' );
3637 }
3738
3839 public function execute (InputInterface $ input , OutputInterface $ output )
3940 {
4041 $ name = $ input ->getArgument ('name ' );
41-
42- $ driver = $ this -> factory ->get ($ name );
42+ $ factory = $ this -> container -> get (DriverFactory::class);
43+ $ driver = $ factory ->get ($ name );
4344
4445 $ driver ->flush ();
4546
Original file line number Diff line number Diff line change 1414
1515use Hyperf \AsyncQueue \Driver \DriverFactory ;
1616use Hyperf \Framework \Annotation \Command ;
17+ use Psr \Container \ContainerInterface ;
1718use Symfony \Component \Console \Command \Command as SymfonyCommand ;
1819use Symfony \Component \Console \Input \InputArgument ;
1920use Symfony \Component \Console \Input \InputInterface ;
2526class InfoCommand extends SymfonyCommand
2627{
2728 /**
28- * @var DriverFactory
29+ * @var ContainerInterface
2930 */
30- protected $ factory ;
31+ protected $ container ;
3132
32- public function __construct (DriverFactory $ factory )
33+ public function __construct (ContainerInterface $ container )
3334 {
34- $ this ->factory = $ factory ;
35+ $ this ->container = $ container ;
3536 parent ::__construct ('queue:info ' );
3637 }
3738
3839 public function execute (InputInterface $ input , OutputInterface $ output )
3940 {
4041 $ name = $ input ->getArgument ('name ' );
41-
42- $ driver = $ this -> factory ->get ($ name );
42+ $ factory = $ this -> container -> get (DriverFactory::class);
43+ $ driver = $ factory ->get ($ name );
4344
4445 $ info = $ driver ->info ();
4546 foreach ($ info as $ key => $ count ) {
Original file line number Diff line number Diff line change 1414
1515use Hyperf \AsyncQueue \Driver \DriverFactory ;
1616use Hyperf \Framework \Annotation \Command ;
17+ use Psr \Container \ContainerInterface ;
1718use Symfony \Component \Console \Command \Command as SymfonyCommand ;
1819use Symfony \Component \Console \Input \InputArgument ;
1920use Symfony \Component \Console \Input \InputInterface ;
2526class ReloadFailedMessageCommand extends SymfonyCommand
2627{
2728 /**
28- * @var DriverFactory
29+ * @var ContainerInterface
2930 */
30- protected $ factory ;
31+ protected $ container ;
3132
32- public function __construct (DriverFactory $ factory )
33+ public function __construct (ContainerInterface $ container )
3334 {
35+ $ this ->container = $ container ;
3436 parent ::__construct ('queue:reload ' );
35- $ this ->factory = $ factory ;
3637 }
3738
3839 public function execute (InputInterface $ input , OutputInterface $ output )
3940 {
4041 $ name = $ input ->getArgument ('name ' );
41-
42- $ driver = $ this -> factory ->get ($ name );
42+ $ factory = $ this -> container -> get (DriverFactory::class);
43+ $ driver = $ factory ->get ($ name );
4344
4445 $ num = $ driver ->reload ();
4546
You can’t perform that action at this time.
0 commit comments