Print verbose result.

@param InputInterface $input
@param float $startTime
@param int $totalFiles

@return void
423711
protected function printLogResult(InputInterface $input, float $startTime, int $totalFiles): void
    {
        $time = round(microtime(true) - $startTime, 2);

        $this->output->writeln('');
        $this->output->writeln('');
        $this->output->writeln('Checked ' . number_format($totalFiles) . ' files in ' . $time . ' seconds.');
        $this->output->write('<info>' . number_format($this->passed) . ' Passed</info>');
        $this->output->write(' / <fg=red>' . number_format(count($this->errors)) . ' Errors</>');
        $this->output->write(' / <fg=yellow>' . number_format(count($this->warnings)) . ' Warnings</>');
        $this->output->writeln('');

        if (!empty($this->errors) && !$input->getOption('info-only')) {
            $this->printErrors();
        }

        if (!empty($this->warnings) && !$input->getOption('info-only')) {
            $this->printWarnings();
        }

        $this->output->writeln('');
    }
491684
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        $method = $this->method;
        $this->setHelperSet($this->getApplication()->getHelperSet());
        if ($this->argument != null) {
            $argument = $input->getArgument($this->argument);
            $this->$method($argument);

            return;
        }

        $this->$method($input,$output);
    }
284393
public function execute(InputInterface $input, OutputInterface $output)
    {
        /** @var QuestionHelper $helper */
        $helper = $this->getHelper('question');

        $copyrightYear = date('Y');
        $packageName = 'Unknown';
        $packageOwner = 'Contributors';
        $packageOwnerEmail = '';

        if ($input->hasOption('name')) {
            $packageName = $input->getOption('name');
        } else {
            $packageName = $helper->ask($input, $output, new Question(
                'What is the package name? '
            ));
        }

        if ($input->hasOption('owner')) {
            $packageOwner = $input->getOption('owner');
        } else {
            $packageOwner = $helper->ask($input, $output, new Question(
                'Who is the package owner? '
            ));
        }

        if ($input->hasOption('email')) {
            $packageOwnerEmail = $input->getOption('email');
        } else {
            $packageOwnerEmail = $helper->ask($input, $output, new Question(
                'What is the contact email of the owner? (Optional) ',
                ''
            ));
        }

        $template = file_get_contents(
            __DIR__ . '/../../../../resources/project/formatter.yml'
        );

        $template = str_replace('<year>', $copyrightYear, $template);
        $template = str_replace('<owner>', $packageOwner, $template);
        $template = str_replace('<package>', $packageName, $template);
        $template = str_replace('<email>', $packageOwnerEmail, $template);

        $filesystem = new Filesystem();

        if ($filesystem->exists('.formatter.yml')) {
            if ($helper->ask($input, $output, new ConfirmationQuestion(
                '.formatter.yml already exists. Overwrite? (y/N) ',
                false
            ))) {
                $filesystem->dumpFile('.formatter.yml', $template);
                $output->writeln('Wrote .formatter.yml');
            }
        } else {
            $filesystem->dumpFile('.formatter.yml', $template);
            $output->writeln('Wrote .formatter.yml');
        }

        if (!$filesystem->exists('.editorconfig')) {
            $filesystem->dumpFile(
                '.editorconfig',
                file_get_contents(
                    __DIR__ . '/../../../../resources/project/editorconfig'
                )
            );
            $output->writeln('Wrote .editorconfig');
        }

        return 0;
    }
380280
public function run(int $totalRecords = null, string $startKey = null, string $stopKey = null): array
    {
        if ($totalRecords !== null) {
            $this->totalRecords = abs($totalRecords);
        }

        if ($startKey) $this->startKey = $startKey;
        if ($stopKey) $this->stopKey = $stopKey;

        // get params could be manipulated by developer setting autorun false
        if ($this->autorun) {
            $this->start = abs($_GET[$this->startKey] ?? 0);
            $this->stop = abs($_GET[$this->stopKey] ?? 0);
        }

        $stop = ($this->stop > 0) ? $this->stop : $this->stopDefault;
        $start = ($this->start > 1) ? ($this->start * $stop) - $stop : 0;

        $this->stop = $stop;
        $this->start = $start;
        if ($this->totalRecords > 0) {
            $this->totalPages = abs((int) ceil($this->totalRecords / $this->stop));
        }

        // safety..
        if (isset($_GET[$this->startKey])) {
            $start = $_GET[$this->startKey];
            if ($start && $start[0] == '-') {
                $this->redirect($this->prepareQuery() . $this->startKey .'='. abs($start), 301);
            } elseif ($start > $this->totalPages) {
                $this->redirect($this->prepareQuery() . $this->startKey .'='. $this->totalPages, 307);
            } elseif ($start == '' || $start == '0' || !ctype_digit($start)) {
                $this->redirect(trim($this->prepareQuery(), '&'), 301);
            }
        }

        // fix start,stop
        if ($this->totalRecords == 1) {
            $this->stop = 1;
            $this->start = 0;
        }

        return [$this->stop, $this->start];
    }
1254095
protected function printp($input, $indent = 0) {
		$input = trim($input, "\n\t\r ");
		$indentation = str_repeat(' ', $indent);
		$this->cli->printf($indentation.wordwrap(str_replace("\n", "\n$indentation", $input), 75 - $indent, "\n$indentation")."\n");
	}
1065958
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->initialiseWorker($input, $output);
        $timePeriod = $input->getOption('period');
        $this->taskQueueService->cleanUpTasks($timePeriod);
    }
614958
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $container = $this->getContainer();
        $taskList  = $container->get('tenside.tasks');

        foreach ($taskList->getIds() as $taskId) {
            $task = $taskList->getTask($taskId);
            $output->writeln(sprintf('<info>%s</info> %s (state: %s)', $taskId, $task->getType(), $task->getStatus()));
        }
    }
32411
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->init($input, $output);

        $this->force_prompt();
                
        $this->publish_packages($this->get_packages());
        
        // Feedback how many files were copied.
        if (\count($this->copied)) {
            $this->output->writeln(
                \sprintf(
                    "\n<info>Published %d %s successfully:\n%s</info>",
                    \count($this->copied),
                    _n('file', 'files', \count($this->copied)),
                    \implode($this->copied, "\n")
                )
            );
            exit;
        }
        
        $this->output->writeln("\n<info>Nothing needed to be published</info>");
    }
21631
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->setup->getLocator()->setParams(
            array(
                'release' => $input->getArgument('release'),
                'path' => $input->getOption('path'),
                'scriptName' => $input->getOption('script')
            )
        );

        $queries = $this->setup($input);

        $this->display($input, $output, $queries);
    }
1301043
public function execute(InputInterface $input, OutputInterface $output)
    {
        try {
            $output->writeln(
                '<comment>Finding and Removing Unused Generated Code</comment>'
            );
            $this->checkOptions($input);
            $removedFiles = $this->remover
                ->setPathToProjectRoot($input->getOption(self::OPT_PROJECT_ROOT_PATH))
                ->setProjectRootNamespace($input->getOption(self::OPT_PROJECT_ROOT_NAMESPACE))
                ->run();
            $output->writeln('<comment>Removed ' . count($removedFiles) . ' Files:</comment>');
            $output->writeln(print_r($removedFiles, true));
            $output->writeln('<info>completed</info>');
        } catch (\Exception $e) {
            throw new DoctrineStaticMetaException(
                'Exception in ' . __METHOD__ . ': ' . $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
    }
786849
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $dryRun = $input->getOption('dry-run');
        $force = $input->getOption('force');
        $dumper = new Dumper();
        $file = sprintf('%s/../Resources/config/mime.yml', __DIR__);

        $result = array();

        if (false !== $content = file_get_contents(self::MIME_FILE)) {
            foreach (explode("\n", $content) as $line) {
                if (false == preg_match('/^#/', $line) && strlen(trim($line)) > 0) {
                    $data = preg_split('/\s+/', $line);
                    for ($i = 1; $i <= count($data) - 1; $i++) {
                        $result[$data[$i]] = $data[0];
                    }
                }
            }
        } else {
            throw new \RuntimeException(sprintf('could not open file: %s', self::MIME_FILE));
        }

        $ymlDump = $dumper->dump($result, 2);

        if ((false === file_exists($file) || $force) && !$dryRun) {
            if (false === file_put_contents($file, $ymlDump)) {
                throw new \RuntimeException(sprintf('could not write to file: %s', $file));
            } else {

                $output->writeln(sprintf('Successful writing file: <info>%s</info>', realpath($file)));
            }
        } elseif (file_exists($file) && !$dryRun) {
            $output->writeln('Mime file exists, use force options to overwrite');
        } elseif ($dryRun) {
            echo $ymlDump;
        }
    }
460715
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $inputFile = $input->getArgument('input-file');
        $exampleFile = $input->getArgument('example-file');
        $number = $input->getOption('number');

        $parserGenerator = new ParserGenerator(new PegFile());

        $parser = $parserGenerator->createParser($inputFile);
        $contents = file_get_contents($exampleFile);
        $start = microtime(true);
        $memoryUsage = $memoryBase = memory_get_usage();

        for ($i = 0; $i < $number; $i++) {
            $parser->parse($contents);

            if ($i === 0) {
                $memoryUsage = memory_get_usage() - $memoryBase;
            }
        }

        $memory = $this->humanReadable($memoryUsage);
        $time = microtime(true) - $start;
        $ms = round($time * 1000);
        $avg = round($time * 1000 / $number);
        $rps = round($number / $time);

        $output->writeln("Memory usage: {$memory}");
        $output->writeln("Number of runs: {$number}");
        $output->writeln("Total time: {$ms}ms");
        $output->writeln("Average time: {$avg}ms");
        $output->writeln("Runs per second: {$rps}");
    }
1247708
public void logInited(long startTime, int totalMaps, int totalReduces) {
    if (disableHistory) {
      return;
    }

    if (null != writers) {
      log(writers, RecordTypes.Job,
          new Keys[] {Keys.JOBID, Keys.LAUNCH_TIME, Keys.TOTAL_MAPS,
                      Keys.TOTAL_REDUCES, Keys.JOB_STATUS},
          new String[] {jobId.toString(), String.valueOf(startTime),
                        String.valueOf(totalMaps),
                        String.valueOf(totalReduces),
                        Values.PREP.name()});
    }
  }
1104218
protected function execute(InputInterface $input, OutputInterface $output)
    {
        /** @var ConfigurationHelper $configurationHelper */
        $configurationHelper = $this->getHelper('phpdocumentor_configuration');
        $target = $configurationHelper->getOption($input, 'target', 'parser/target');
        if (strpos($target, '/tmp/') === 0) {
            $target = str_replace('/tmp/', sys_get_temp_dir() . DIRECTORY_SEPARATOR, $target);
        }
        
        $fileSystem = new Filesystem();
        if (! $fileSystem->isAbsolutePath($target)) {
            $target = getcwd().DIRECTORY_SEPARATOR.$target;
        }
        if (!file_exists($target)) {
            mkdir($target, 0777, true);
        }
        if (!is_dir($target)) {
            throw new \Exception($this->__('PPCPP:EXC-BADTARGET'));
        }
        $this->getCache()->getOptions()->setCacheDir($target);

        $builder = $this->getBuilder();
        $builder->createProjectDescriptor();
        $projectDescriptor = $builder->getProjectDescriptor();

        $output->write($this->__('PPCPP:LOG-COLLECTING'));
        $files = $this->getFileCollection($input);

        /** @var Finder $exampleFinder */
        $exampleFinder = $this->getContainer()->offsetGet('parser.example.finder');
        $exampleFinder->setSourceDirectory($files->getProjectRoot());
        $exampleFinder->setExampleDirectories($configurationHelper->getConfigValueFromPath('files/examples'));
        $output->writeln($this->__('PPCPP:LOG-OK'));

        /** @var ProgressHelper $progress  */
        $progress = $this->getProgressBar($input);
        if (!$progress) {
            $this->getHelper('phpdocumentor_logger')->connectOutputToLogging($output, $this);
        }

        $output->write($this->__('PPCPP:LOG-INITIALIZING'));
        $this->populateParser($input, $files);

        if ($progress) {
            $progress->start($output, $files->count());
        }

        try {
            $output->writeln($this->__('PPCPP:LOG-OK'));
            $output->writeln($this->__('PPCPP:LOG-PARSING'));

            $mapper = new ProjectDescriptorMapper($this->getCache());
            $mapper->garbageCollect($files);
            $mapper->populate($projectDescriptor);

            $visibility = (array) $configurationHelper->getOption($input, 'visibility', 'parser/visibility');
            $visibilities = array();
            foreach ($visibility as $item) {
                $visibilities = $visibilities + explode(',', $item);
            }
            $visibility = null;
            foreach ($visibilities as $item) {
                switch ($item) {
                    case 'public':
                        $visibility |= ProjectDescriptor\Settings::VISIBILITY_PUBLIC;
                        break;
                    case 'protected':
                        $visibility |= ProjectDescriptor\Settings::VISIBILITY_PROTECTED;
                        break;
                    case 'private':
                        $visibility |= ProjectDescriptor\Settings::VISIBILITY_PRIVATE;
                        break;
                }
            }
            if ($visibility === null) {
                $visibility = ProjectDescriptor\Settings::VISIBILITY_DEFAULT;
            }
            if ($input->getOption('parseprivate')) {
                $visibility = $visibility | ProjectDescriptor\Settings::VISIBILITY_INTERNAL;
            }
            $projectDescriptor->getSettings()->setVisibility($visibility);

            $this->getParser()->parse($builder, $files);
        } catch (FilesNotFoundException $e) {
            throw new \Exception($this->__('PPCPP:EXC-NOFILES'));
        } catch (\Exception $e) {
            throw new \Exception($e->getMessage(), 0, $e);
        }

        if ($progress) {
            $progress->finish();
        }

        $projectDescriptor->setPartials($this->getService('partials'));

        $output->write($this->__('PPCPP:LOG-STORECACHE', (array) $this->getCache()->getOptions()->getCacheDir()));
        $projectDescriptor->getSettings()->clearModifiedFlag();
        $mapper->save($projectDescriptor);

        $output->writeln($this->__('PPCPP:LOG-OK'));

        return 0;
    }
503861
public function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        try {
            $this->doExecute($input, $output);
        } catch (\Exception $e) {
            $this->writeException($e);
        }
    }
279839
public function execute(InputInterface $input, OutputInterface $output)
    {
        $app = $this->getSilexApplication();
        $view = $input->getArgument('view');
        $dir = $input->getArgument('dir');
        $type = $input->getArgument('type');

        $author = $input->getOption('author');
        
        if (!$author) {
            if (isset($app['author.name'])) {
                $author = $app['author.name'];
            } else {
                $author = 'Author';
            }
        }

        $email = $input->getOption('email');

        if (!$email) {
            if (isset($app['author.email'])) {
                $email = $app['author.email'];
            } else {
                $email = 'author@email.com';
            }
        }
        
        try {
            $app['singular.service.front_view']->create($view, $dir, $type, $author, $email);
            $output->writeln(sprintf('<info>View "%s" criada com sucesso!</info>',$view));
        } catch (\Exception $e) {
            $output->writeln(sprintf('<error>%s</error>', $e->getMessage()));
        }

    }
391571
protected function execute(InputInterface $input, OutputInterface $output)
    {
        parent::execute($input, $output);

        $info = $this
            ->getSession()
            ->getInspector()
            ->getSchemaRelations($this->fetchSchemaOid()
        );
        $this->formatOutput($output, $info);
    }