From 6a5f3d457ecbbc0edf0579e02e1ec4b86ee48142 Mon Sep 17 00:00:00 2001 From: Peter Dulacka Date: Fri, 27 Dec 2019 16:20:24 +0100 Subject: [PATCH] Adding exit codes to all commands due to change in Symfony Commands in symfony framework are now required to provide exit code in every `execute()` method. --- src/commands/CalculateAveragesCommand.php | 2 ++ src/commands/CidGetterCommand.php | 2 ++ src/commands/CsobMailConfirmationCommand.php | 2 ++ src/commands/LastPaymentsCheckCommand.php | 2 ++ src/commands/RecurrentPaymentsCardCheckCommand.php | 2 ++ src/commands/RecurrentPaymentsChargeCommand.php | 2 ++ src/commands/StopRecurrentPaymentsExpiresCommand.php | 2 ++ src/commands/TatraBankaMailConfirmationCommand.php | 2 ++ src/commands/UpdateRecurrentPaymentsExpiresCommand.php | 4 +++- 9 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/commands/CalculateAveragesCommand.php b/src/commands/CalculateAveragesCommand.php index 9e0a448..a09029e 100644 --- a/src/commands/CalculateAveragesCommand.php +++ b/src/commands/CalculateAveragesCommand.php @@ -93,5 +93,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ON DUPLICATE KEY UPDATE `updated_at`=NOW(), `value`=VALUES(value); SQL ); + + return 0; } } diff --git a/src/commands/CidGetterCommand.php b/src/commands/CidGetterCommand.php index 2886728..109a032 100644 --- a/src/commands/CidGetterCommand.php +++ b/src/commands/CidGetterCommand.php @@ -46,6 +46,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->cidMailDownloader->download(function ($mailContent) use ($output) { return $this->markMailProcessed($mailContent, $output); }, $input->getArgument('variable_symbol')); + + return 0; } private function markMailProcessed($mailContent, $output) diff --git a/src/commands/CsobMailConfirmationCommand.php b/src/commands/CsobMailConfirmationCommand.php index 2e53e5b..cef49ac 100644 --- a/src/commands/CsobMailConfirmationCommand.php +++ b/src/commands/CsobMailConfirmationCommand.php @@ -34,6 +34,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->mailDownloader->download(function ($mailContents) use ($output) { return $this->markMailProcessed($mailContents, $output); }); + + return 0; } private function markMailProcessed(array $mailContents, OutputInterface $output) diff --git a/src/commands/LastPaymentsCheckCommand.php b/src/commands/LastPaymentsCheckCommand.php index 9e38f0f..bf96daa 100644 --- a/src/commands/LastPaymentsCheckCommand.php +++ b/src/commands/LastPaymentsCheckCommand.php @@ -169,6 +169,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->output->writeln("Done gateway {$gateway->name}\n"); } + + return 0; } /** diff --git a/src/commands/RecurrentPaymentsCardCheckCommand.php b/src/commands/RecurrentPaymentsCardCheckCommand.php index b9a5344..3732455 100644 --- a/src/commands/RecurrentPaymentsCardCheckCommand.php +++ b/src/commands/RecurrentPaymentsCardCheckCommand.php @@ -57,5 +57,7 @@ public function execute(InputInterface $input, OutputInterface $output) $output->writeln(''); $output->writeln('All done. Took ' . round($duration, 2) . ' sec.'); $output->writeln(''); + + return 0; } } diff --git a/src/commands/RecurrentPaymentsChargeCommand.php b/src/commands/RecurrentPaymentsChargeCommand.php index c85bd9f..8007777 100644 --- a/src/commands/RecurrentPaymentsChargeCommand.php +++ b/src/commands/RecurrentPaymentsChargeCommand.php @@ -291,6 +291,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $output->writeln(''); $output->writeln('All done. Took ' . round($duration, 2) . ' sec.'); $output->writeln(''); + + return 0; } private function validateRecurrentPayment($recurrentPayment) diff --git a/src/commands/StopRecurrentPaymentsExpiresCommand.php b/src/commands/StopRecurrentPaymentsExpiresCommand.php index 6388a05..75cc459 100644 --- a/src/commands/StopRecurrentPaymentsExpiresCommand.php +++ b/src/commands/StopRecurrentPaymentsExpiresCommand.php @@ -95,5 +95,7 @@ public function execute(InputInterface $input, OutputInterface $output) $output->writeln(''); $output->writeln('All done. Took ' . round($duration, 2) . ' sec.'); $output->writeln(''); + + return 0; } } diff --git a/src/commands/TatraBankaMailConfirmationCommand.php b/src/commands/TatraBankaMailConfirmationCommand.php index 4578a47..b59d254 100644 --- a/src/commands/TatraBankaMailConfirmationCommand.php +++ b/src/commands/TatraBankaMailConfirmationCommand.php @@ -34,6 +34,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->mailDownloader->download(function ($mailContent) use ($output) { return $this->markMailProcessed($mailContent, $output); }); + + return 0; } private function markMailProcessed($mailContent, $output) diff --git a/src/commands/UpdateRecurrentPaymentsExpiresCommand.php b/src/commands/UpdateRecurrentPaymentsExpiresCommand.php index e4e4cb6..0fc1e96 100644 --- a/src/commands/UpdateRecurrentPaymentsExpiresCommand.php +++ b/src/commands/UpdateRecurrentPaymentsExpiresCommand.php @@ -73,7 +73,7 @@ public function execute(InputInterface $input, OutputInterface $output) $gateway = $this->paymentGatewaysRepository->findByCode($code); if (!$gateway) { $output->writeln("ERROR: gateway {$code} doesn't exist:"); - return; + return 1; } $recurrentPayments->where(['payment_gateway_id' => $gateway->id]); } @@ -124,5 +124,7 @@ public function execute(InputInterface $input, OutputInterface $output) $output->writeln(''); $output->writeln('All done. Took ' . round($duration, 2) . ' sec.'); $output->writeln(''); + + return 0; } }