@param $command
@param callable $next

@return string
961523
public function execute($command, callable $next)
    {
        if ($command instanceof QueuedCommand && !$command->isRunningInQueue())
        {
            $delay = $command->getDelay() !== null ?: $this->delay;

            $command->setRunningInQueue(true);
            $job = new QueuedJobWrapper([
                'command' => $command,
                'commandBus' => $this->commandBus
            ]);

            return $this->queue->delay($delay)->push($job);
        }

        return $next($command);
    }
212050
public function execute($command, callable $next)
    {
        // should find from real storage eg. mysql
        $command->storage = $storage = new CommandData();
        $command->merge($storage->getLineCommandData());

        $storage->setLineUserId($command->input->userId);
        $storage->setLineActiveCmd($command->getCmd());

        return $next($command);
    }
796456
public function execute(string $command): string
    {
        $result = shell_exec($command);
        if ($result === null) {
            $result = '';
        }
        return $result;
    }
214103
public function execute(Command $command, callable $next)
    {
        if (class_exists('phpDocumentor\Event\Dispatcher')) {
            Dispatcher::getInstance()->dispatch(
                'parser.file.pre',
                PreFileEvent::createInstance($this)->setFile($command->getFile()->path())
            );
        }

        return $next($command);
    }
225009
protected function generateCommandUrl(string $command, array $parameters = [])
    {
        $query = '';
        if (!empty($parameters)) {
            $query = '?' . http_build_query($parameters);
        }

        return $this->ssoServerUrl . '/sso/' . $command . $query;
    }
606272
private function wrapCommandWithMessageEnvelope($command)
    {
        if ($command instanceof Command) {
            return $command;
        }

        if ($command instanceof Serializable) {
            return new GenericCommand(MessageIdentifier::generate(), $command);
        }

        throw new \InvalidArgumentException('Unsupported data type.');
    }
952652
public function execute($command, callable $next)
    {
        $filename = $command->getFile()->path();
        $this->apiDocBuilder->debug('Starting to parse file: ' . $filename);
        try {
            return $next($command);
        } catch (\Exception $e) {
            $this->apiDocBuilder->log('Unable to parse file "' . $filename . '", ' . $e->getMessage());
        }
        return null;
    }
852770
protected function sendCommand(string $command) : string
    {
        try {
            $client = new Client;
            $client->addServer($this->config['sockets']['client']);
            $response = $client->sendCommand($command);
            $client->close();
            return $response;
        } catch (ClientException $e) {
            return 'error';
        }
    }
764531
public function execute(Command $command)
    {
        if ($command instanceof QueueableCommand) {
            $this->queuer->queue($command);
            return null;
        }

        return $this->innerCommandBus->execute($command);
    }
1326695
protected function getUrl(Command $command)
    {
        return $this->url
            .(stripos($this->url, '?') !== false ? '&' : '?')
            .http_build_query([self::COMMAND => $command->getName()]);
    }
1337169
public function execute(string $command): string
    {
        return $this->shellFacade->runCommand($this->command . ' ' . $command);
    }
620945
public function getCallbacks($command)
    {
        $result = array();
        $command = strtolower($command);

        if (isset($this->_callbacks[$command])) {
            $result = $this->_callbacks[$command];
        }

        return $result;
    }
31589
public function execute($command, callable $next)
    {
        $repository = Manager::getRepository(User::class);

        if (!$user = $repository->findOneBy(['lineUserId' => $command->input->userId])) {
            $user = new User();
        }

        $command->storage = $user;
        $command->merge((array) $user->getLineCommandData());

        $user->setLineUserId($command->input->userId);

        return $next($command);
    }
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
		);
	}
624592
public function handle($command, Closure $next)
    {
        return DB::transaction(function () use ($command, $next) {
            return $next($command);
        });
    }
934454
public function execute($command, callable $next)
    {
        if ($this->user->getId() === null) {
            throw new NotAuthenticatedException();
        }

        if (!$this->user->can($this->permission)) {
            throw new InsufficientPermissionsException($this->permission);
        }

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

        if (!$command->secured && LoginCommand::CMD !== $command->storage->getLineActiveCmd()) {
            return $next($command);
        }

        if (!$this->isSecureExpired($command->storage)) {
            return $next($command);
        }

        $command->switchTo(LoginCommand::class);

        return $next($command);
    }