Foo3Command.php 833 B

1234567891011121314151617181920212223242526272829
  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. try {
  18. throw new \Exception('First exception <p>this is html</p>');
  19. } catch (\Exception $e) {
  20. throw new \Exception('Second exception <comment>comment</comment>', 0, $e);
  21. }
  22. } catch (\Exception $e) {
  23. throw new \Exception('Third exception <fg=blue;bg=red>comment</>', 0, $e);
  24. }
  25. }
  26. }