Overtrue\PHPLint\Command\LintCommand::execute PHP Метод

execute() защищенный Метод

This method is not abstract because you can use this class as a concrete class. In this case, instead of defining the execute() method, you set the code to execute by passing a Closure to the setCode() method.
См. также: setCode()
protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : null | integer
$input Symfony\Component\Console\Input\InputInterface An InputInterface instance
$output Symfony\Component\Console\Output\OutputInterface An OutputInterface instance
Результат null | integer null or 0 if everything went fine, or an error code
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $startTime = microtime(true);
        $startMemUsage = memory_get_usage(true);
        $output->writeln($this->getApplication()->getLongVersion() . " by overtrue and contributors.\n");
        $options = $this->mergeOptions();
        $verbosity = $output->getVerbosity();
        if ($verbosity >= OutputInterface::VERBOSITY_DEBUG) {
            $output->writeln('Options: ' . json_encode($options));
        }
        $linter = new Linter($options['path'], $options['exclude'], $options['extensions']);
        $linter->setProcessLimit($options['jobs']);
        if (!$input->getOption('no-cache') && Cache::isCached()) {
            $output->writeln('Using cache.');
            $linter->setCache(Cache::get());
        }
        $fileCount = count($linter->getFiles());
        if ($fileCount <= 0) {
            $output->writeln('<info>Could not find files to lint</info>');
            return 0;
        }
        $errors = $this->executeLint($linter, $output, $fileCount, !$input->getOption('no-cache'));
        $timeUsage = Helper::formatTime(microtime(true) - $startTime);
        $memUsage = Helper::formatMemory(memory_get_usage(true) - $startMemUsage);
        $code = 0;
        $errCount = count($errors);
        $output->writeln("\n\nTime: {$timeUsage}, Memory: {$memUsage}MB\n");
        if ($errCount > 0) {
            $output->writeln('<error>FAILURES!</error>');
            $output->writeln("<error>Files: {$fileCount}, Failures: {$errCount}</error>");
            $this->showErrors($errors);
            $code = 1;
        } else {
            $output->writeln("<info>OK! (Files: {$fileCount}, Success: {$fileCount})</info>");
        }
        return $code;
    }