Describes a manifest.

@param ManifestInterface $manifest Manifest
@param OutputInterface   $output   Output
508366
private function describeManifest(ManifestInterface $manifest, OutputInterface $output)
    {
        $builder = new ProcedureBuilder();
        $manifest->configureProcedureBuilder($builder);

        $output->writeln(sprintf("Manifest description for <info>%s</info>\n", $manifest->getName()));
        $output->writeln("<fg=blue;options=bold>PROCEDURE CONFIGURATION</fg=blue;options=bold>\n");

        $this->describeProcedure($builder->getProcedure(), $output);
    }
1367468
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        $aliasName = $input->getArgument('aliasName');
        $aliasClass = $input->getArgument('aliasClass');
        $this->alias($aliasName, $aliasClass);
    }
307038
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $align = $input->getOption('align') === Step::ALIGN_TO_LEFT
            ? Step::ALIGN_TO_LEFT
            : Step::ALIGN_TO_RIGHT;

        $directory = $input->getArgument('directory');
        $finder    = (new FeatureResolve($directory))->__invoke();

        $output->writeln("\nFinding files on <info>" . $directory . "</info>\n");

        /* @var $file \Symfony\Component\Finder\SplFileInfo */
        foreach ($finder as $file) {

            $fileContent            = $file->getContents();
            $contentWithoutComments = $this->removeComments($fileContent);
            $feature                = $this->parser->parse($fileContent);

            $formatted = (new ComposedFormatter(
                new FeatureDescription(),
                new Background($align),
                new Scenario($align),
                new Tags()
            ))
                ->__invoke($feature);

            if ($formatted !== $contentWithoutComments) {

                if (! defined('FAILED')) {
                    define('FAILED', true);
                }

                $diff = new Differ("--- Original\n+++ Expected\n", false);

                $output->writeln('<error>Wrong style: ' . $file->getRealPath() . '</error>');
                $output->writeln($diff->diff($contentWithoutComments, $formatted));
            }
        }

        if (defined('FAILED')) {
            return 1;
        }

        $output->writeln('<bg=green;fg=white>     Everything is OK!     </>');
    }
936606
public function execute(InputInterface $input, OutputInterface $output)
    {
        $description = $input->getArgument('description');
        $time        = date('YmdHis');
        $classname   = $this->generateClassName($time, $description);
        $filepath    = APPDIR.'/src/'.$this->namespaceToPath().$classname.'.php';

        if (! is_dir(dirname($filepath))) {
            mkdir(dirname($filepath), 0775, true);
        }

        $view = $this->newMigrationView;

        $view->description($description);
        $view->classname($classname);
        $view->timestamp($time);

        file_put_contents($filepath, (string) $view);

        $message = '  Created migration file '.$filepath;

        // Output message padded by newlines
        $output->write(['', $message, ''], true);
    }
129914
public function writeManifest(array $manifest)
    {
        if (! is_writable(dirname($this->manifestPath))) {
            throw new Exception('The bootstrap/cache directory must be present and writable.');
        }

        $this->files->put(
            $this->manifestPath,
            '<?php return '.var_export($manifest, true).';'
        );

        return array_merge(['when' => []], $manifest);
    }
492518
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->pidFilePath = $input->getOption('pid-file');
        $this->logFilePath = $input->getOption('log-file');

        $state = $input->getArgument('state');

        switch ($state) {
            case 'start':
                $this->startDaemon();
                break;
            case 'stop':
                $this->stopDaemon();
                break;
            case 'status':
                $this->statusDaemon($output);
                break;
            default:
                $this->output->writeln("<error>Not a valid choice, please use start, stop or status</error>");
                break;
        }
    }
65433
private function registerSignals(OutputInterface $output)
    {
        foreach ($this->signalCallbacks as $signal => $callbacks) {
            foreach ($callbacks as $callback) {
                pcntl_signal($signal, function() use ($signal, $output, $callback) {
                    if ($output->isVerbose()) {
                        $output->writeln("Received signal '$signal', calling registered callback.");
                    }
                    return $callback();
                });
            }
        }
    }
141113
public function setOutput(\Symfony\Component\Console\Output\OutputInterface $output)
    {
        $this->output = $output;
    }
1324908
protected static function configureFormatter(OutputInterface $output)
    {
        $formatter = $output->getFormatter();
        $formatter->setStyle('system', new OutputFormatterStyle('green'));
        $formatter->setStyle('line', new OutputFormatterStyle('yellow'));
        $formatter->setStyle('fail', new OutputFormatterStyle('red'));
        $formatter->setStyle('info', new OutputFormatterStyle('blue'));
        $formatter->setStyle('body', new OutputFormatterStyle('white'));
        $formatter->setStyle('strong', new OutputFormatterStyle(null, null, ['bold']));
    }
589729
private function createMigrationsTable(OutputInterface $output = null)
    {
        if (!is_null($output)) {
            $output->writeln('<info>Creating migrations table</info>');
        }
        $m = new CreateMigrationsTable();
        $m->up();
    }
1305245
public function handle(PackageManifest $manifest)
    {
        $manifest->build();

        foreach (array_keys($manifest->manifest) as $package) {
            $this->line("Discovered Package: <info>{$package}</info>");
        }

        $this->info('Package manifest generated successfully.');
    }
130126
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);

        $days = $input->getArgument('days');
        $entries = $this
            ->metricLoader
            ->loadEntriesFromLastDays($days);

        $nbEntries = count($entries);
        $this->printMessage(
            $output,
            'Metric',
            'Added ' . $nbEntries . ' entries from last ' . $days . ' days'
        );

        $this->finishCommand($output);
    }
1140758
public function runApplication(InputInterface $input = null, OutputInterface $output = null): void
    {
        $this->getFactory()->createApplication()->run($input, $output);
    }
521780
protected function execute(InputInterface $input, OutputInterface $output): void
    {
        $configFilesOption = $input->getOption('config');
        $outputOption = $input->getOption('output');
        $formatOption = $input->getOption('format');

        '@phan-var string $configFilesOption';
        '@phan-var string $outputOption';
        '@phan-var string $formatOption';

        $configFiles       = $this->getPossibleConfigFiles($configFilesOption);
        $configuration     = $this->linterConfigurationLocator->loadConfiguration($configFiles);
        $paths             = $input->getArgument('paths') ?: $configuration->getPaths();
        $outputTarget      = $input->getOption('output');
        $exitWithExitCode  = $input->getOption('exit-code') || $input->getOption('fail-on-warnings');

        '@phan-var string[] $paths';

        if (false == $outputTarget) {
            throw new BadOutputFileException('Bad output file.');
        }

        if ($outputOption === '-') {
            $reportOutput = $output;
        } else {
            $fileHandle = fopen($outputOption, 'w');
            if ($fileHandle === false) {
                throw new \Exception("could not open file '${outputOption}' for writing");
            }

            $reportOutput = new StreamOutput($fileHandle);
        }

        $logger = $this->loggerBuilder->createLogger($formatOption, $reportOutput, $output);

        $report   = new Report();
        $patterns = $configuration->getFilePatterns();

        $files = $this->finder->getFilenames($paths, $patterns, new CallbackFinderObserver(function ($name) use ($logger) {
            $logger->notifyFileNotFound($name);
        }));
        $logger->notifyFiles($files);

        foreach ($files as $filename) {
            $logger->notifyFileStart($filename);
            $fileReport = $this->linter->lintFile($filename, $report, $configuration, $logger);
            $logger->notifyFileComplete($filename, $fileReport);
        }

        $logger->notifyRunComplete($report);

        $exitCode = 0;
        if ($report->countIssuesBySeverity(Issue::SEVERITY_ERROR) > 0) {
            $exitCode = 2;
        } else if ($exitWithExitCode && $report->countIssues() > 0) {
            $exitCode = 2;
        }

        $this->eventDispatcher->addListener(
            ConsoleEvents::TERMINATE,
            function (ConsoleTerminateEvent $event) use ($exitCode) {
                $event->setExitCode($exitCode);
            }
        );
    }
121437
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->requireConfig();

        $output->writeln('Starting <fg=blue>Magallanes</>');
        $output->writeln('');

        try {
            $this->runtime->setEnvironment($input->getArgument('environment'));

            $strategy = $this->runtime->guessStrategy();
            $this->taskFactory = new TaskFactory($this->runtime);

            if (!$this->runtime->getEnvOption('releases', false)) {
                throw new RuntimeException('Releases are not enabled', 70);
            }

            $releaseToRollback = $input->getArgument('release');
            if (($releaseId = $this->checkReleaseAvailability($releaseToRollback)) === false) {
                throw new RuntimeException(sprintf('Release "%s" is not available on all hosts', $releaseToRollback), 72);
            }

            $this->runtime->setReleaseId($releaseId)->setRollback(true);

            $output->writeln(sprintf('    Environment: <fg=green>%s</>', $this->runtime->getEnvironment()));
            $this->log(sprintf('Environment: %s', $this->runtime->getEnvironment()));

            $output->writeln(sprintf('    Rollback to Release Id: <fg=green>%s</>', $this->runtime->getReleaseId()));
            $this->log(sprintf('Release ID: %s', $this->runtime->getReleaseId()));

            if ($this->runtime->getConfigOption('log_file', false)) {
                $output->writeln(sprintf('    Logfile: <fg=green>%s</>', $this->runtime->getConfigOption('log_file')));
            }

            $output->writeln(sprintf('    Strategy: <fg=green>%s</>', $strategy->getName()));

            $output->writeln('');
            $this->runDeployment($output, $strategy);
        } catch (RuntimeException $exception) {
            $output->writeln(sprintf('<error>%s</error>', $exception->getMessage()));
            $this->statusCode = $exception->getCode();
        }

        $output->writeln('Finished <fg=blue>Magallanes</>');

        return $this->statusCode;
    }
946925
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
        $output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
        $errOutput->setVerbosity(OutputInterface::VERBOSITY_NORMAL);

        $context = json_decode($input->getOption('context') ?: '{}', true);
        $context['tenant_id'] = (string)$input->getOption('tenant-id');

        $nodeRef = NodeRef::fromString($input->getArgument('node-ref'));
        $consistent = $input->getOption('consistent') ? true : false;

        try {
            $node = $this->ncr->getNode($nodeRef, $consistent, $context);
            echo json_encode($node, $input->getOption('pretty') ? JSON_PRETTY_PRINT : 0) . PHP_EOL;
        } catch (\Throwable $e) {
            $errOutput->writeln($e->getMessage());
        }
    }
152039
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->purgeMissingFamilies($output);
        $this->purgeMissingAttributes($output);
    }