diff --git a/Command/RetryCommand.php b/Command/RetryCommand.php index d2ca724..9019f74 100644 --- a/Command/RetryCommand.php +++ b/Command/RetryCommand.php @@ -33,8 +33,6 @@ class RetryCommand extends Command /** * RetryCommand constructor. - * - * @param MongoDriverInterface $mongoDriver */ public function __construct(JobQueue $queue, FailedJobProviderInterface $failer) { diff --git a/Command/RunJobCommand.php b/Command/RunJobCommand.php index e07c7c0..3755a09 100644 --- a/Command/RunJobCommand.php +++ b/Command/RunJobCommand.php @@ -24,8 +24,7 @@ class RunJobCommand extends Command /** * RunJobCommand constructor. - * - * @param LoggerInterface $logger + * @param Worker $worker */ public function __construct(Worker $worker) { diff --git a/DependencyInjection/QueueExtension.php b/DependencyInjection/QueueExtension.php index 527867c..4dfb15e 100644 --- a/DependencyInjection/QueueExtension.php +++ b/DependencyInjection/QueueExtension.php @@ -21,7 +21,6 @@ use SfCod\QueueBundle\Service\QueueManager; use SfCod\QueueBundle\Worker\Worker; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\EventDispatcher\EventDispatcherInterface; diff --git a/Event/JobFailedEvent.php b/Event/JobFailedEvent.php index 557cdf0..d71fa86 100644 --- a/Event/JobFailedEvent.php +++ b/Event/JobFailedEvent.php @@ -43,7 +43,6 @@ class JobFailedEvent extends Event * @param string $connectionName * @param JobContractInterface $job * @param Exception $exception - * @param array $config */ public function __construct(string $connectionName, JobContractInterface $job, Exception $exception) { diff --git a/Event/JobProcessedEvent.php b/Event/JobProcessedEvent.php index dc55db2..caa52d0 100644 --- a/Event/JobProcessedEvent.php +++ b/Event/JobProcessedEvent.php @@ -34,7 +34,6 @@ class JobProcessedEvent extends Event * * @param string $connectionName * @param JobContractInterface $job - * @param array $config */ public function __construct(string $connectionName, JobContractInterface $job) { diff --git a/Event/JobProcessingEvent.php b/Event/JobProcessingEvent.php index 606b7a6..8b38345 100644 --- a/Event/JobProcessingEvent.php +++ b/Event/JobProcessingEvent.php @@ -34,7 +34,6 @@ class JobProcessingEvent extends Event * * @param string $connectionName * @param JobContractInterface $job - * @param array $config */ public function __construct(string $connectionName, JobContractInterface $job) { diff --git a/Worker/Worker.php b/Worker/Worker.php index 76edddf..49a87b7 100644 --- a/Worker/Worker.php +++ b/Worker/Worker.php @@ -46,7 +46,7 @@ class Worker /** * Logger instance * - * @var ExceptionHandler + * @var ExceptionHandlerInterface */ private $exceptions; @@ -65,12 +65,12 @@ class Worker /** * @var JobProcess */ - private $jobProcess; + private $process; /** * Worker constructor. * - * @param QueueInterface $queue + * @param QueueManager $queueManager * @param JobProcess $process * @param FailedJobProviderInterface $failer * @param ExceptionHandlerInterface $exceptions @@ -251,7 +251,7 @@ public function memoryExceeded(int $memoryLimit) */ public function stop(int $status = 0) { - $this->dispatcher->dispatch(self::EVENT_STOP, new WorkerStoppingEvent()); + $this->dispatcher->dispatch(new WorkerStoppingEvent(), self::EVENT_STOP); exit(0); } @@ -409,7 +409,7 @@ protected function getNextJob(QueueInterface $connection, string $queue): ?JobCo */ protected function raiseBeforeJobEvent(string $connectionName, JobContractInterface $job) { - $this->dispatcher->dispatch(self::EVENT_RAISE_AFTER_JOB, new JobProcessingEvent($connectionName, $job)); + $this->dispatcher->dispatch(new JobProcessingEvent($connectionName, $job), self::EVENT_RAISE_AFTER_JOB); } /** @@ -420,7 +420,7 @@ protected function raiseBeforeJobEvent(string $connectionName, JobContractInterf */ protected function raiseAfterJobEvent(string $connectionName, JobContractInterface $job) { - $this->dispatcher->dispatch(self::EVENT_RAISE_AFTER_JOB, new JobProcessedEvent($connectionName, $job)); + $this->dispatcher->dispatch(new JobProcessedEvent($connectionName, $job), self::EVENT_RAISE_AFTER_JOB); } /** @@ -432,7 +432,7 @@ protected function raiseAfterJobEvent(string $connectionName, JobContractInterfa */ protected function raiseExceptionOccurredJobEvent(string $connectionName, JobContractInterface $job, Exception $e) { - $this->dispatcher->dispatch(self::EVENT_RAISE_EXCEPTION_OCCURED_JOB, new JobExceptionOccurredEvent($connectionName, $job, $e)); + $this->dispatcher->dispatch(new JobExceptionOccurredEvent($connectionName, $job, $e), self::EVENT_RAISE_EXCEPTION_OCCURED_JOB); } /** @@ -444,6 +444,6 @@ protected function raiseExceptionOccurredJobEvent(string $connectionName, JobCon */ protected function raiseFailedJobEvent(string $connectionName, JobContractInterface $job, Exception $e) { - $this->dispatcher->dispatch(self::EVENT_RAISE_FAILED_JOB, new JobFailedEvent($connectionName, $job, $e)); + $this->dispatcher->dispatch(new JobFailedEvent($connectionName, $job, $e), self::EVENT_RAISE_FAILED_JOB); } }