@param AbstractCommand $command

{@inheritdoc}
550849
public function execute($command, callable $next)
    {
        // dev only
        if ($this->isDebug && $command->logs) {
            VarDumper::dump($command->logs);
        }

        return $next($command);
    }
14276
protected function doSendCommand(Command $command): void
    {
        if (!$this->shouldUseGearman()) {
            $this->locator->getCommandBus()->receiveCommand($command);
            return;
        }

        $envelope = new TransportEnvelope($command, 'php');
        $channel = $this->router->forCommand($command);

        try {
            $client = $this->getClient();
            @$client->doBackground($channel, $envelope->toString(), (string)$command->get('command_id'));
            $this->validateReturnCode($client, $channel);
        } catch (\GearmanException $ge) {
            if (isset(self::$reconnectCodes[$ge->getCode()])) {
                $this->destroyClient();
                $this->locator->getCommandBus()->receiveCommand($command);
                return;
            }

            throw $ge;
        } catch (\Throwable $e) {
            throw $e;
        }
    }
1033225
public function execute($command, callable $next)
    {
        if (!$command->storage) {
            throw new \LogicException("Require storage before using this middleware!");
        }

        $command->storage->setLineCommandData($command->getData());

        return $next($command);
    }
1173658
public function fire(Command $command)
    {
        $this->command = $command;

        $connected = false;

        while (! $connected) {
            $host = $this->askDatabaseHost();

            $name = $this->askDatabaseName();

            $user = $this->askDatabaseUsername();

            $password = $this->askDatabasePassword();

            $this->setLaravelConfiguration($name, $user, $password, $host);

            if ($this->databaseConnectionIsValid()) {
                $connected = true;
            } else {
                $command->error('Please ensure your database credentials are valid.');
            }
        }

        $this->env->write($name, $user, $password, $host);

        $command->info('Database successfully configured');
    }
1145408
public function describe(AbstractCommand $command)
	{
		// Describe Options
		$options          = $command->getAllOptions();
		$optionDescriptor = $this->getOptionDescriptor();

		foreach ($options as $option)
		{
			$optionDescriptor->addItem($option);
		}

		$render['option'] = count($options) ? "\n\nOptions:\n\n" . $optionDescriptor->render() : '';

		// Describe Commands
		$commands          = $command->getChildren();
		$commandDescriptor = $this->getCommandDescriptor();

		foreach ($commands as $cmd)
		{
			$commandDescriptor->addItem($cmd);
		}

		$render['command'] = count($commands) ? "\nAvailable commands:\n\n" . $commandDescriptor->render() : '';

		// Render Help template
		/** @var Console $console */
		$console = $command->getApplication();

		if (!($console instanceof Console))
		{
			throw new \RuntimeException(sprintf('Help descriptor need Console object in %s command.', get_class($command)));
		}

		$consoleName = $console->getName();
		$version     = $console->getVersion();

		$commandName = $command->getName();
		$description = $command->getDescription();
		$usage       = $command->getUsage();
		$help        = $command->getHelp();

		// Clean line indent of description
		$description = explode("\n", $description);

		foreach ($description as &$line)
		{
			$line = trim($line);
		}

		$description = implode("\n", $description);
		$description = $description ? $description . "\n" : '';

		$template = sprintf(
			$this->template,
			$consoleName,
			$version,
			$commandName,
			$description,
			$usage,
			$help
		);

		return str_replace(
			array('{OPTIONS}', '{COMMANDS}'),
			$render,
			$template
		);
	}
263931
public function handle(CommandInterface $command)
    {
        $object = $command->getParameter('data');

        if ($command->hasParameter('class')) {
            $class = $command->getParameter('class');
            if (!($object instanceof $class)) {
                return CommandResult::error('invalid_instance');
            }
        }

        try {
            $this->objectManager->flush();
        } catch (ForeignKeyConstraintViolationException $e) {
            return CommandResult::error('constraint_violation');
        }
    }
285224
private function call($command)
    {
        if (!in_array($command, static::COMMAND)) {
            $this->throwFailsCommand("The command '$command' not exists.", 'help');
        }

        if (!$this->arg->getParameter('action')) {
            if ($this->arg->getParameter('target') == 'help') {
                $this->help($command);

                exit(0);
            }
        }

        try {
            call_user_func_array(
                [$this, $command],
                [$this->arg->getParameter('target')]
            );
        } catch (\Exception $e) {
            echo $e->getMessage();

            exit(1);
        }
    }
272554
public function command($command)
    {
        if ($command instanceof CommandInterface) {
            $command->setContainer($this);
        }

        $this['console']->add($command);
    }
716149
public function runCommand($command, OutputInterface $output = null)
    {
        $input = new StringInput($command);

        $command = $this->find($this->getCommandName($input));

        return $command->run($input, $output ?: new NullOutput());
    }
780743
public function rawcommand($command)
    {
        if (preg_match('/(.+)[\n]$/', $command)) {
            $this->socket->send($command);
        } else {
            $this->socket->send($command.PHP_EOL);
        }
    }
410218
public function fire(Command $command)
    {
        $this->command = $command;

        if ($command->option('verbose')) {
            $command->blockMessage('Requirements', 'Checking System Requirements ...', 'comment');
        }

        $this->checkPHPVersion();
        $this->checkExtensions();

        $this->showResults();
    }
1365839
protected function execute($command)
    {
        $process = new Process($command);
        $process->setTimeout(null);
        $process->run();

        if (!$process->isSuccessful()) {
            throw new \RuntimeException($process->getErrorOutput());
        }
    }
1026212
protected function _commandEnable($command)
    {
        $entity = $this->getController()->getItem();

        $label = AnTranslator::_('COM-TODOS-ACTION-'.strtoupper($entity->enabled ? 'disable' : 'enable'));

        $action = ($entity->enabled) ? 'disable' : 'enable';

        $command->append(array('label' => $label));

        if ($command->ajax) {
            $command
            ->href($entity->getURL().'&layout=list')
            ->setAttribute('data-action', $action);
        } else {
            $command
            ->href($entity->getURL().'&action='.$action)
            ->setAttribute('data-trigger', 'PostLink');
        }
    }
958712
final public function handle(Command $command): void
    {
        $supportedCommandType = $this->getSupportedCommandType();
        if (!\is_a($command, $supportedCommandType)) {
            throw new InvalidCommandException(\sprintf(
                'Command must be a %s, %s given',
                $supportedCommandType,
                \get_class($command)
            ));
        }

        $this->handleCommand($command);
    }
1130097
public function addCommand($command)
    {
        if (is_string($command)) {
            $command = $this->app->make($command);
        }

        if ($command instanceof Command) {
            $command->setLaravel($this->app);
        }

        $this->console->add($command);
    }
805130
public function handle(CommandInterface $command)
    {
        $object = $command->getParameter('data');

        if ($command->hasParameter('class')) {
            $class = $command->getParameter('class');
            if (!($object instanceof $class)) {
                return CommandResult::error('invalid_instance');
            }
        }

        $this->objectManager->persist($object);
        $this->objectManager->flush();
    }
1055
public function setCommand($command)
    {
        if (! in_array($command, self::VALID_COMMANDS)) {
            throw new InvalidArgumentException('Invalid command sent');
        }

        $this->command = $command;

        return $this;
    }