Foo3Command.php 621 B

12345678910111213141516171819202122232425
  1. <?php
  2. use Symfony\Component\Console\Command\Command;
  3. use Symfony\Component\Console\Input\InputInterface;
  4. use Symfony\Component\Console\Output\OutputInterface;
  5. class Foo3Command extends Command
  6. {
  7. protected function configure()
  8. {
  9. $this
  10. ->setName('foo3:bar')
  11. ->setDescription('The foo3:bar command')
  12. ;
  13. }
  14. protected function execute(InputInterface $input, OutputInterface $output)
  15. {
  16. try {
  17. throw new \Exception("First exception");
  18. } catch (\Exception $e) {
  19. throw new \Exception("Second exception", 0, $e);
  20. }
  21. }
  22. }