GlobalAnalyzer.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Mtf\Troubleshooting;
  7. use Symfony\Component\Console\Input\InputInterface;
  8. use Symfony\Component\Console\Output\OutputInterface;
  9. /**
  10. * Perform all checks.
  11. */
  12. class GlobalAnalyzer extends \Symfony\Component\Console\Command\Command
  13. {
  14. /**
  15. * List of commands.
  16. *
  17. * @var \Magento\Mtf\Console\CommandList
  18. */
  19. private $commandList;
  20. /**
  21. * @param \Symfony\Component\Console\Command\Command[] $commandList
  22. */
  23. public function __construct(
  24. $commandList
  25. ) {
  26. parent::__construct();
  27. $this->commandList = $commandList;
  28. }
  29. /**
  30. * Configure command.
  31. *
  32. * @return void
  33. */
  34. protected function configure()
  35. {
  36. parent::configure();
  37. $this->setName('troubleshooting:check-all')
  38. ->setDescription('Perform all available checks.');
  39. }
  40. /**
  41. * Execute command.
  42. *
  43. * @param InputInterface $input
  44. * @param OutputInterface $output
  45. * @return void
  46. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  47. */
  48. protected function execute(InputInterface $input, OutputInterface $output)
  49. {
  50. foreach ($this->commandList as $command) {
  51. $command->execute($input, $output);
  52. $output->writeln('');
  53. }
  54. }
  55. }