Skip to content

Commit

Permalink
Adding exit codes to all commands due to change in Symfony
Browse files Browse the repository at this point in the history
Commands in symfony framework are now required to provide exit code
in every `execute()` method.
  • Loading branch information
rootpd committed Dec 27, 2019
1 parent 8031f88 commit 6a5f3d4
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/commands/CalculateAveragesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
ON DUPLICATE KEY UPDATE `updated_at`=NOW(), `value`=VALUES(value);
SQL
);

return 0;
}
}
2 changes: 2 additions & 0 deletions src/commands/CidGetterCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/commands/CsobMailConfirmationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/commands/LastPaymentsCheckCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ protected function execute(InputInterface $input, OutputInterface $output)

$this->output->writeln("Done gateway <info>{$gateway->name}</info>\n");
}

return 0;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/commands/RecurrentPaymentsCardCheckCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@ public function execute(InputInterface $input, OutputInterface $output)
$output->writeln('');
$output->writeln('<info>All done. Took ' . round($duration, 2) . ' sec.</info>');
$output->writeln('');

return 0;
}
}
2 changes: 2 additions & 0 deletions src/commands/RecurrentPaymentsChargeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln('');
$output->writeln('<info>All done. Took ' . round($duration, 2) . ' sec.</info>');
$output->writeln('');

return 0;
}

private function validateRecurrentPayment($recurrentPayment)
Expand Down
2 changes: 2 additions & 0 deletions src/commands/StopRecurrentPaymentsExpiresCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,7 @@ public function execute(InputInterface $input, OutputInterface $output)
$output->writeln('');
$output->writeln('<info>All done. Took ' . round($duration, 2) . ' sec.</info>');
$output->writeln('');

return 0;
}
}
2 changes: 2 additions & 0 deletions src/commands/TatraBankaMailConfirmationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion src/commands/UpdateRecurrentPaymentsExpiresCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function execute(InputInterface $input, OutputInterface $output)
$gateway = $this->paymentGatewaysRepository->findByCode($code);
if (!$gateway) {
$output->writeln("<error>ERROR: gateway <info>{$code}</info> doesn't exist:</error>");
return;
return 1;
}
$recurrentPayments->where(['payment_gateway_id' => $gateway->id]);
}
Expand Down Expand Up @@ -124,5 +124,7 @@ public function execute(InputInterface $input, OutputInterface $output)
$output->writeln('');
$output->writeln('<info>All done. Took ' . round($duration, 2) . ' sec.</info>');
$output->writeln('');

return 0;
}
}

0 comments on commit 6a5f3d4

Please sign in to comment.