diff --git a/Console/Command/Clear.php b/Console/Command/Clear.php index 432930d..5403477 100644 --- a/Console/Command/Clear.php +++ b/Console/Command/Clear.php @@ -29,6 +29,7 @@ class Clear extends Command /** @var ProgressBarFactory */ private $progressBarFactory; + // phpcs:ignore public function __construct( ConfirmationQuestionFactory $confirmationQuestionFactory, CoreHelper $coreHelper, @@ -45,7 +46,9 @@ public function __construct( $this->progressBarFactory = $progressBarFactory; } - /** @inheritDoc */ + /** + * @inheritDoc + */ protected function configure() { $this->setName('discorgento:queue:clear'); @@ -54,14 +57,18 @@ protected function configure() parent::configure(); } - /** @inheritDoc */ + /** + * @inheritDoc + */ protected function execute(InputInterface $input, OutputInterface $output) { $messages = $this->messagesCollectionFactory->create(); $totalMessages = $messages->getSize(); if ($totalMessages < 1) { - return $output->writeln("There's no pending jobs."); + $output->writeln("There's no pending jobs."); + + return self::SUCCESS; } if ($this->coreHelper->isProductionMode()) { @@ -89,5 +96,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $output->writeln(PHP_EOL . 'Done.'); + + return self::SUCCESS; } } diff --git a/Console/Command/Execute.php b/Console/Command/Execute.php index 9a0f62a..4fec5ab 100644 --- a/Console/Command/Execute.php +++ b/Console/Command/Execute.php @@ -17,6 +17,7 @@ class Execute extends Command /** @var ProgressBarFactory */ private $progressBarFactory; + // phpcs:ignore public function __construct( MessageManagementInterface $messageManagement, ProgressBarFactory $progressBarFactory, @@ -27,7 +28,9 @@ public function __construct( $this->progressBarFactory = $progressBarFactory; } - /** @inheritDoc */ + /** + * @inheritDoc + */ protected function configure() { $this->setName('discorgento:queue:execute'); @@ -36,14 +39,18 @@ protected function configure() parent::configure(); } - /** @inheritDoc */ + /** + * @inheritDoc + */ protected function execute(InputInterface $input, OutputInterface $output) { $pendingMessages = $this->messageManagement->getPending(); $totalMessages = $pendingMessages->getTotalCount(); if ($totalMessages < 1) { - return $output->writeln("There's no pending jobs."); + $output->writeln("There's no pending jobs."); + + return self::SUCCESS; } $output->writeln('Executing the jobs in queue..'); @@ -62,5 +69,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $progressBar->finish(); $output->writeln(PHP_EOL . 'Done.'); + + return self::SUCCESS; } } diff --git a/Console/Command/Retry.php b/Console/Command/Retry.php index d9702ab..b6162d5 100644 --- a/Console/Command/Retry.php +++ b/Console/Command/Retry.php @@ -17,6 +17,7 @@ class Retry extends Command /** @var ProgressBarFactory */ private $progressBarFactory; + // phpcs:ignore public function __construct( MessageManagementInterface $messageManagement, ProgressBarFactory $progressBarFactory, @@ -27,7 +28,9 @@ public function __construct( $this->progressBarFactory = $progressBarFactory; } - /** @inheritDoc */ + /** + * @inheritDoc + */ protected function configure() { $this->setName('discorgento:queue:retry'); @@ -36,14 +39,18 @@ protected function configure() parent::configure(); } - /** @inheritDoc */ + /** + * @inheritDoc + */ protected function execute(InputInterface $input, OutputInterface $output) { $failedJobs = $this->messageManagement->getToBeRetried(); $totalMessages = count($failedJobs); if ($totalMessages < 1) { - return $output->writeln("There's no jobs waiting to be retried."); + $output->writeln("There's no jobs waiting to be retried."); + + return self::SUCCESS; } $output->writeln('Retrying the failed jobs..'); @@ -61,5 +68,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $progressBar->finish(); $output->writeln(PHP_EOL . 'Done.'); + + return self::SUCCESS; } }