diff --git a/src/Command/MangoCancelUnpaidOrdersCommand.php b/src/Command/MangoCancelUnpaidOrdersCommand.php index 8ec6e1a..4ec9dbd 100644 --- a/src/Command/MangoCancelUnpaidOrdersCommand.php +++ b/src/Command/MangoCancelUnpaidOrdersCommand.php @@ -58,7 +58,7 @@ protected function configure(): void /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output): void + protected function execute(InputInterface $input, OutputInterface $output): int { $expirationTime = $this->expirationPeriod; $methodCodes = $this->expirationMethodCodes; @@ -72,5 +72,7 @@ protected function execute(InputInterface $input, OutputInterface $output): void $this->unpaidCartsStateUpdater->cancel(); $this->entityManager->flush(); + + return 0; } } diff --git a/src/Command/UpdateExchangeRatesCommand.php b/src/Command/UpdateExchangeRatesCommand.php index 051faca..2b8275f 100644 --- a/src/Command/UpdateExchangeRatesCommand.php +++ b/src/Command/UpdateExchangeRatesCommand.php @@ -47,7 +47,7 @@ protected function configure(): void ->setDescription('Update exchange rates.'); } - protected function execute(InputInterface $input, OutputInterface $output): void + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $io->title($this->getName() . ' started at ' . date('Y-m-d H:i:s')); @@ -122,5 +122,7 @@ protected function execute(InputInterface $input, OutputInterface $output): void $io->success( $this->getName() . ' at ' . date('Y-m-d H:i:s') ); + + return 0; } } diff --git a/src/Command/UpdateProductPriceByExchangeRatesCommand.php b/src/Command/UpdateProductPriceByExchangeRatesCommand.php index 8b42f43..8f629d4 100644 --- a/src/Command/UpdateProductPriceByExchangeRatesCommand.php +++ b/src/Command/UpdateProductPriceByExchangeRatesCommand.php @@ -68,7 +68,7 @@ protected function configure(): void ->setDescription('Update product prices by exchange rates.'); } - protected function execute(InputInterface $input, OutputInterface $output): void + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $io->title($this->getName() . ' started at ' . date('Y-m-d H:i:s')); @@ -86,7 +86,7 @@ protected function execute(InputInterface $input, OutputInterface $output): void if (!in_array($decimals, [0, 1, 2], true)) { $io->error('Option round has allowed values 0, 1 or 2'); - return; + return 1; } assert(is_string($sourceChannelParam)); @@ -100,7 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output): void $this->logger->error($errorMsg); $io->error($errorMsg); - return; + return 2; } assert($sourceChannel instanceof ChannelInterface); assert($targetChannel instanceof ChannelInterface); @@ -121,7 +121,7 @@ protected function execute(InputInterface $input, OutputInterface $output): void $this->logger->error($errorMsg); $io->error($errorMsg); - return; + return 3; } assert($exchangeRate instanceof ExchangeRateInterface); if ($exchangeRate->getRatio() === null || $exchangeRate->getRatio() === 0) { @@ -129,7 +129,7 @@ protected function execute(InputInterface $input, OutputInterface $output): void $this->logger->error($errorMsg); $io->error($errorMsg); - return; + return 4; } } @@ -175,6 +175,8 @@ protected function execute(InputInterface $input, OutputInterface $output): void $io->success( $this->getName() . ' at ' . date('Y-m-d H:i:s') ); + + return 0; } private function roundPrice(int $price, int $decimals): int