CancelOrderCommand.php 741 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\command;
  3. use Symfony\Component\Console\Command\Command;
  4. use Symfony\Component\Console\Input\InputInterface;
  5. use Symfony\Component\Console\Output\OutputInterface;
  6. class CancelOrderCommand extends Command
  7. {
  8. protected static $defaultName = 'cancel:order';
  9. protected static $defaultDescription = '取消订单';
  10. /**
  11. * @param InputInterface $input
  12. * @param OutputInterface $output
  13. * @return int
  14. */
  15. protected function execute(InputInterface $input, OutputInterface $output)
  16. {
  17. try {
  18. throw new \Exception('取消失败~');
  19. }catch (\Exception $exception){
  20. throw new \Exception($exception->getMessage(), $exception->getCode());
  21. }
  22. }
  23. }