protected function execute(InputInterface $input, OutputInterface $output) { try { $this->application->runCommand($this->createCommandFromInput($input)); if ($this->errorDataCollector->getErrorCount()) { $this->infoMessagePrinter->printFoundErrorsStatus($input->getOption('fix')); return ExitCode::ERROR; } $this->codeSnifferStyle->success('Great job! Your code is completely fine. Take a break and look around you.'); return ExitCode::SUCCESS; } catch (Throwable $throwable) { $this->codeSnifferStyle->error($throwable->getMessage()); return ExitCode::ERROR; } }
private function printErrors() { $this->codeSnifferStyle->writeErrorReports($this->errorDataCollector->getErrorMessages()); $this->codeSnifferStyle->error(sprintf('%d error(s) found.', $this->errorDataCollector->getErrorCount())); }