private function printFixingNote()
 {
     if ($fixableCount = $this->errorDataCollector->getFixableErrorCount()) {
         $howMany = $fixableCount;
         if ($fixableCount === $this->errorDataCollector->getErrorCount()) {
             $howMany = 'ALL';
         }
         $this->codeSnifferStyle->success(sprintf('Good news is, we can fix %s of them for you. Just add "--fix".', $howMany));
     }
 }
예제 #2
0
 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;
     }
 }