@param InputInterface  $input
@param OutputInterface $output

@return string
540090
protected function getUsername(InputInterface $input, OutputInterface $output): string
    {
        $username = $input->getArgument('username');
        if (null === $username) {
            if (!$input->isInteractive()) {
                throw new \UnexpectedValueException('Missing username argument');
            }
            /** @var QuestionHelper $questionHelper */
            $questionHelper = $this->getHelper('question');
            $question = new Question(
                "<info>{$this->translator->trans('admin.user.form.username.label')}: </info>"
            );
            $username = $questionHelper->ask($input, $output, $question);
        }

        return $username;
    }
1367468
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        $aliasName = $input->getArgument('aliasName');
        $aliasClass = $input->getArgument('aliasClass');
        $this->alias($aliasName, $aliasClass);
    }
965828
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);

        $configurationIdentifier = $input->getArgument('identifier');
        $configurationValue = json_encode($this
            ->configurationManager
            ->get($configurationIdentifier));

        $this->printMessage(
            $output,
            'Configuration',
            $configurationIdentifier . ' : "' . $configurationValue . '"'
        );

        $this->finishCommand($output);
    }
1071262
public function createTable(InputInterface $input, OutputInterface $output)
    {
        $databse = $this->getApplication()->find('create:table');
        $databse_arguments = array(
            'command'   => 'create:table',
            'table'     => $input->getArgument('table'),
            'column'    => $input->getArgument('column')
        );
        $input_db   = new ArrayInput($databse_arguments);
        $return_db  = $databse->run($input_db,$output);
        return $output->writeln($return_db);
    }
482196
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->injectOutputIntoLogger($output, $this->logger);
        $adapter = $this->databaseImportExportAdapterManager->getAdapter($input->getOption('adapter'));
        $adapter->setLogger($this->logger);

        $database = $input->getArgument('database');
        $path = $input->getArgument('path');
        $ignoreTables = $input->getOption('ignore-tables') ? explode(',', $input->getOption('ignore-tables')) : [];

        $this->logger->info("Exporting database \"$database\".");
        $filename = $adapter->exportToFile(
            $database,
            $path,
            [
                'ignore_tables'   => $ignoreTables,
                'remove_definers' => !$input->getOption('no-remove-definers'),
            ]
        );
        $this->logger->info("Database \"$database\" exported to \"$filename\"!");
        return 0;
    }
534714
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->getHelper('phpdocumentor_logger')->connectOutputToLogging($output, $this);

        $converter = $this->getConverter($input);
        $converter->setOption('title', $input->getOption('title'));

        $output->writeln('Collect all documents');
        $files = $this->buildCollection(
            $input->getArgument('source'),
            $converter->getDefinition()->getInputFormat()->getExtensions()
        );

        $output->writeln('Converting documents');
        $files = $converter->convert($files, $this->getTemplate($input));

        $output->writeln('Writing converted documents to disk');
        $this->writeToDisk($files, $input->getOption('target'));

        $output->writeln('Writing assets to disk');
        $converter->getAssets()->copyTo($input->getOption('target'));
    }
1260967
public static function getInstance(OutputInterface $output, InputInterface $input)
    {
        $questionHelper = new QuestionHelper();
        $application    = new Application('Code Generator Command Line Interface', 'Alpha');
        $application->getHelperSet()->set(new FormatterHelper(), 'formatter');
        $application->getHelperSet()->set($questionHelper, 'question');

        $context = new CliContext(
            $questionHelper,
            $output,
            $input,
            CreateCommandFactory::getInstance($application)
        );

        $mainBackbone = MainBackboneFactory::getInstance($context);

        $mainBackbone->run();

        return $application;
    }
318522
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $verbosity = PhpVersions::VERBOSITY_NORMAL;
        $verbosity = $input->getOption('verbose') == 2 ? PhpVersions::VERBOSITY_VERBOSE : $verbosity;
        $verbosity = $input->getOption('verbose') == 3 ? PhpVersions::VERBOSITY_DEBUG : $verbosity;
        $verbosity = $input->getOption('quiet') ? PhpVersions::VERBOSITY_SILENT : $verbosity;
        $phpVersions = new PhpVersions(null, $verbosity);

        $versions = $input->getArgument('php');
        $version = array_shift($versions);
        if (empty($version)) {
            $version = 'latest';
        }

        $type = $input->getOption('type');
        if (empty($type)) {
            $type = 'sha256';
        }

        $format = $input->getOption('format');
        if (empty($format)) {
            $format = null;
        }

        $info = $phpVersions->getSourceInfo($version, $format);

        $output->write(isset($info[$type]) ? $info[$type] : '');
    }
1177449
protected function execute(InputInterface $input, OutputInterface $output)
  {
    $this->_input = $input;
    $this->_output = $output;

    $params = array_values($input->getArguments());
    //Strip off the command name
    array_shift($params);

    //Call the execute command with $input and $output as the first args
    if(method_exists($this, 'executeCommand'))
    {
      array_unshift($params, $input, $output);
      return $this->executeCommand(...$params);
    }

    //Call the process method, without $input and $output
    if(method_exists($this, 'process'))
    {
      return $this->process(...$params);
    }

    throw new \RuntimeException(
      "Your command must contain one of the following methods:\n" .
      "process()\n" .
      'executeCommand(InputInterface $input, OutputInterface $output)' . "\n",
      500
    );
  }
1292311
public function execute(InputInterface $input, OutputInterface $output)
    {
        return $this->go(new Input($input), new Output($output));
    }
419662
public function execute(InputInterface $input, OutputInterface $output)
    {
        $argument = $input->getArgument($this->argumentName);
        $path = $this->basePath.'/'.$argument.'.php';

        if ($input->hasOption('restful') && $input->getOption('restful') == true) {
            $this->restful = true;
        } else {
            $this->restful = false;
        }

        $response = $this->runFileGeneratorCommand($path, $argument);

        if ($response === true) {
            $this->type ?: $this->type = 'Command';
            $output->writeln(ucfirst($this->type).' created successfully');

            return;
        }
        $output->writeln($response);
    }
391077
protected function execute(InputInterface $input, OutputInterface $output)
    {
		$this->input = $input;
		$this->output = $output;
		$this->force = $input->getOption('force');
		
		$helper = $this->getHelper('question');
		
        $userQuestion = new Question('User (root): ', 'root');
		
        $passwordQuestion = new Question('Password (): ', '');
		$passwordQuestion->setHidden(true);
		$passwordQuestion->setHiddenFallback(false);

        $hostQuestion = new Question('Host (localhost): ', 'localhost');
        $driverQuestion = new Question('Driver (pdo_mysql): ', 'pdo_mysql');
		
		$user = $helper->ask($input, $output, $userQuestion);
		$password = $helper->ask($input, $output, $passwordQuestion);
		$host = $helper->ask($input, $output, $hostQuestion);
		$driver = $helper->ask($input, $output, $driverQuestion);
		
		$connectionParams = array(
			'user' => $user,
			'password' => $password,
			'host' => $host,
			'driver' => $driver
		);
		
		try {
			$conn = $this->createConnection($connectionParams);
			
			$sm = $conn->getSchemaManager();
			
			$databases = $sm->listDatabases();
			
			$question = new ChoiceQuestion(
				'Database',
				$databases,
				0
			);
			$question->setErrorMessage('Selected database is not valid');

			$dbName = $helper->ask($input, $output, $question);
			$output->writeln('Chosen database: ' . $dbName);
			
			//Add the dbname property
			$connectionParams['dbname'] = $dbName;
			
			$conn = $this->createConnection($connectionParams);
			
			$sm = $conn->getSchemaManager();
		
			$tables = $sm->listTables();
			
			$this->loadConfiguration();
			
			$progress = new ProgressBar($output, count($tables));
			$progress->start();
			
			foreach ($tables as $table) {
				//$output->writeln($table->getName() . " columns:\n\n");
					
				//Columns
				/*
				foreach ($table->getColumns() as $column) {
					//$output->writeln(' - ' . $column->getName() . ': ' . $column->getType() . "\n");
				}
				*/
					
				//Foreign keys
				$name = $table->getName();
				$table = $sm->listTableDetails($name);
				//$foreignKeys = $table->getForeignKeys();
				//$output->writeln("Foreign keys (" . count($foreignKeys) . ")");
				/*
				foreach ($foreignKeys as $foreignKey) {
					//$output->writeln("\n");
					$foreignColumns = $foreignKey->getForeignColumns();
					$localColumns = $foreignKey->getLocalColumns();
					foreach($foreignColumns as $key => $foreignColumn){
						//$output->writeln($foreignKey->getLocalTableName() . "." . $localColumns[$key] . " <=> " . $foreignKey->getForeignTableName() . "." . $foreignColumn . "\n");
					}
				}
				*/
		
				$primaryKeys = $table->getPrimaryKeyColumns();
				//$output->writeln("Primary keys (" . count($primaryKeys) . ")");
				/*
				foreach ($primaryKeys as $primaryKey) {
					//$output->writeln("\n" . $primaryKey);
				}
				*/
				
				//$output->writeln("\n\n");
				$this->generateCode($name, reset($primaryKeys));
				
				$progress->advance();
			}
			
			$progress->finish();
		} catch(\Exception $ex){
			$output->writeln('Generator has found the current exception: ');
			$output->writeln($ex->getMessage());
		}
    }
108254
protected function execute(InputInterface $input, OutputInterface $output)
  {
    $name = strtolower($input->getArgument('name'));
    $table = $input->getOption('table');

    $class = implode('', array_map('ucfirst', explode('_', $name)));

    if ($table == null || $table == '') {
      if ($this->add($name, $class)) {
        return $output->writeln('<info>Migration "' . $class . '" has been successfully created.</info>');
      }

      return $output->writeln('Migration "' . $class . '" already exists.');
    }

    if ($this->add($name, $class, $table)) {
      return $output->writeln('<info>Migration "' . $class . '" has been successfully created.</info>');
    }

    return $output->writeln('Migration "' . $class . '" already exists.');
  }
489985
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $finder     = new Finder();
        $filesystem = new Filesystem();
        $filesystem->remove($finder->directories()->in($this->getLanguageBasePath()));
    }
1250158
public function cacheClear(InputInterface $input, OutputInterface $output)
    {
        $output->writeln(sprintf('Cache path: <info>%s</info>', __DIR__ . '/.cache'));
        $files = glob(__DIR__ . '/.cache/tables' . '/*');
        if (!empty($files)) {
            foreach ($files as $file) {
                $output->writeln('  <info>-></info> ' . $file);
                if ($input->hasParameterOption(['--clear'])) {
                    unlink($file);
                    $output->writeln(sprintf(
                        '    <info>✔</info> Table <info>"%s"</info> cache is clean <info>done.</info>',
                        pathinfo($file, PATHINFO_FILENAME)
                    ));
                }
            }
        } else {
            $output->writeln(sprintf('  <comment>!!</comment> Empty cache.'));
        }

        $files = glob(__DIR__ . '/.cache/dataset' . '/*');
        if (!empty($files)) {
            foreach ($files as $file) {
                $output->writeln('  <info>-></info> ' . $file);
                if ($input->hasParameterOption(['--clear'])) {
                    unlink($file);
                    $output->writeln(sprintf(
                        '    <info>✔</info> Table <info>"%s"</info> dataset is clean <info>done.</info>',
                        pathinfo($file, PATHINFO_FILENAME)
                    ));
                }
            }
        } else {
            $output->writeln(sprintf('  <comment>!!</comment> Empty dataset.'));
        }
    }
1349202
public function text(InputInterface $input, OutputInterface $output)
    {
        foreach ($this->router->getRoutes() as $route) {
            if (!empty($route->getName())) {
                $output->writeln('<fg=cyan;options=bold>'.$route->getName().'</>');
                $output->writeln('    '.implode(', ', $route->getMethods()));
                $output->writeln('    '.$route->getPattern());
                if (is_string($route->getCallable())) {
                    $output->writeln('    '.$route->getCallable());
                }

                $output->writeln('');
            }
        }
    }
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}");
    }