inspectionRunner = $inspectionRunner; } protected function configure() { $this ->setName('System inspection') ->setDescription('Runs specified system inspections') ->addArgument('type', InputArgument::OPTIONAL, 'What system inspection type do you want to run? [compile, user]', CompileInspectionInterface::INSPECTION_KEYWORD) ->addArgument('output', InputArgument::OPTIONAL, 'What writer will inspections use [exception, activity]', 'exception'); } protected function execute(InputInterface $input, OutputInterface $output) { $output = $input->getArgument('output'); if ($output == 'activity') { $writer = new ActivityLogWriter(); } elseif ($output == 'exception') { $writer = new ExceptionWriter(); } else { throw new \Exception('Invalid output parameter'); } $type = $input->getArgument('type'); $this->inspectionRunner->runInspection($type, $writer); return 0; } }