1818
1919namespace JMS \JobQueueBundle \Command ;
2020
21+ use Doctrine \Bundle \DoctrineBundle \Registry ;
2122use Doctrine \ORM \EntityManager ;
2223use JMS \JobQueueBundle \Entity \Job ;
2324use JMS \JobQueueBundle \Entity \Repository \JobManager ;
2425use JMS \JobQueueBundle \Event \NewOutputEvent ;
2526use JMS \JobQueueBundle \Event \StateChangeEvent ;
2627use JMS \JobQueueBundle \Exception \InvalidArgumentException ;
27- use Symfony \Bridge \Doctrine \ManagerRegistry ;
2828use Symfony \Component \Console \Command \Command ;
2929use Symfony \Component \Console \Input \InputInterface ;
3030use Symfony \Component \Console \Input \InputOption ;
@@ -46,7 +46,7 @@ class RunCommand extends Command
4646 /** @var OutputInterface */
4747 private $ output ;
4848
49- /** @var ManagerRegistry */
49+ /** @var Registry */
5050 private $ registry ;
5151
5252 /** @var JobManager */
@@ -67,7 +67,7 @@ class RunCommand extends Command
6767 /** @var array */
6868 private $ queueOptions ;
6969
70- public function __construct (ManagerRegistry $ managerRegistry , JobManager $ jobManager , EventDispatcherInterface $ dispatcher , array $ queueOptionsDefault , array $ queueOptions )
70+ public function __construct (Registry $ managerRegistry , JobManager $ jobManager , EventDispatcherInterface $ dispatcher , array $ queueOptionsDefault , array $ queueOptions )
7171 {
7272 parent ::__construct ();
7373
@@ -283,13 +283,13 @@ private function checkRunningJobs()
283283
284284 if ( ! empty ($ newOutput )) {
285285 $ event = new NewOutputEvent ($ data ['job ' ], $ newOutput , NewOutputEvent::TYPE_STDOUT );
286- $ this ->dispatcher ->dispatch ('jms_job_queue.new_job_output ' , $ event );
286+ $ this ->dispatcher ->dispatch ($ event , 'jms_job_queue.new_job_output ' );
287287 $ newOutput = $ event ->getNewOutput ();
288288 }
289289
290290 if ( ! empty ($ newErrorOutput )) {
291291 $ event = new NewOutputEvent ($ data ['job ' ], $ newErrorOutput , NewOutputEvent::TYPE_STDERR );
292- $ this ->dispatcher ->dispatch ('jms_job_queue.new_job_output ' , $ event );
292+ $ this ->dispatcher ->dispatch ($ event , 'jms_job_queue.new_job_output ' );
293293 $ newErrorOutput = $ event ->getNewOutput ();
294294 }
295295
@@ -350,7 +350,7 @@ private function checkRunningJobs()
350350 private function startJob (Job $ job )
351351 {
352352 $ event = new StateChangeEvent ($ job , Job::STATE_RUNNING );
353- $ this ->dispatcher ->dispatch ('jms_job_queue.job_state_change ' , $ event );
353+ $ this ->dispatcher ->dispatch ($ event , 'jms_job_queue.job_state_change ' );
354354 $ newState = $ event ->getNewState ();
355355
356356 if (Job::STATE_CANCELED === $ newState ) {
0 commit comments