@param object|BaseCommand $command
@param callable $next

@return mixed
558241
public function execute($command, callable $next)
    {
        try {
            return $next($command);
        } catch (NotAuthenticatedException $exception) {
            return $this->handleAuthenticationError($command, $exception);
        } catch (DomainException|\DomainException $domainException) {
            return $this->handleDomainException($command, $domainException);
        } catch (\InvalidArgumentException $argumentException) {
            return $this->handleArgumentException($command, $argumentException);
        } catch (\Exception $exception) {
            return $this->handleUnclassifiedError($command, $exception);
        }
    }
1290792
public function call($command, array $parameters = [])
    {
        $this->bootstrap();

        return $this->getArtisan()->call($command, $parameters);
    }
11059
public function registerSubCommand($command, $callable, array $options = [])
    {
        if (array_key_exists($command, $this->subCommands)) {
            throw new \Exception("A sub-command with the name {$command} already exists.");
        }

        list($commandInstance, $options) = $this->client->buildCommand($command, $callable, $options);
        $this->subCommands[$command]     = $commandInstance;

        foreach ($options['aliases'] as $alias) {
            $this->addSubCommandAlias($alias, $command);
        }

        return $commandInstance;
    }
245337
private function buildCommand($command, $argument)
    {
        $command = sprintf($command, $argument);
        $this->output->writeln(
            'Calling following command:' . "\n" . $command,
            OutputInterface::VERBOSITY_DEBUG
        );

        return $command;
    }
1057840
public function execute($command, callable $next)
    {
        if ($this->transactionLevel > 0) {
            $this->storeMessages();
        }

        ++$this->transactionLevel;

        end($this->transactionMessages);
        $savepoint = key($this->transactionMessages);
        $savepoint = $savepoint === null ? 0 : ++$savepoint;

        try {
            $returnValue = $next($command);

            $this->storeMessages();

            --$this->transactionLevel;
        } catch (\Exception $e) {
            $this->capturer->clear();
            array_splice($this->transactionMessages, $savepoint);

            --$this->transactionLevel;
            throw $e;
        } catch (\Error $e) {
            $this->capturer->clear();
            array_splice($this->transactionMessages, $savepoint);

            --$this->transactionLevel;
            throw $e;
        }

        if ($this->transactionLevel === 0) {
            $this->publish();
        }

        return $returnValue;
    }
983613
public function execute($command, callable $next)
    {
        $result = $next($command);

        $events = $this->eventStorage->release();
        $this->emitEvents($events);

        return $result;
    }
150755
public static function fromCommand(OperationCommand $command)
    {
        $response = $command->getResponse();
        $json     = $response->json();

        return self::fromArray($json);
    }
1018668
protected function call($command, $params = [])
    {
        $parameters['command'] = $command;

        foreach($params as $key => $value) {
            $parameters[$key] = $value;
        }

        $command = $this->getApplication()->find($command);

        return $command->run(new ArrayInput($parameters), $this->output);
    }
1127493
public function execute($command, callable $next)
    {
        if (!$command->validate()) {
            throw new ValidationException(implode(', ', $command->getFirstErrors()));
        }

        return $next($command);
    }
575247
public function getCommandHandler($command)
    {
        if ($this->hasCommandHandler($command)) {
            return $this->container->make($this->handlers[get_class($command)]);
        }

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

            $command->storage->setLineActiveCmd($command->getCmd());
            $command->storage->setLineCommandData($command->getData());
        }

        return $next($command);
    }
1113628
public function execute($command = null, array $args = array(), array $options = array())
    {
        $command = $command ?: $this->defaultCommand;
        if (!isset($this->commands[$command])) {
            throw new ConsoleException("Command '$command' does not exist");
        }
        
        $callback = $this->commands[$command];
        if (is_callable($callback)) {
            $params = array($args, $options);
            if (is_string($callback)) {
                if (strpos($callback, '::') !== false) {
                    list($classname, $methodname) = explode('::', $callback);
                    $reflection = new ReflectionMethod($classname, $methodname);
                } else {
                    $reflection = new ReflectionFunction($callback);
                }
                $params = Utils::computeFuncParams($reflection, $args, $options);
            }
            $params[] = $this;
            return call_user_func_array($callback, $params);
        }

        $method = new ReflectionMethod($callback, 'execute');
        $params = Utils::computeFuncParams($method, $args, $options);
        return $method->invokeArgs(new $callback($this), $params);
    }
938726
public function getCommand($command, $aliases = true)
    {
        if (array_key_exists($command, $this->commands)) {
            return $this->commands[$command];
        }

        if (array_key_exists($command, $this->aliases) && $aliases) {
            return $this->commands[$this->aliases[$command]];
        }
    }
1343115
public function handle($command, $next)
    {
        $files = $this->parseFilesIntoArray($command->files());

        $this->normalizeFiles($files, $command);
        $command->files($this->collection);

        return $next($command);
    }
268606
public function execute($command, callable $next)
    {
        try {
            $result = $next($command);
        } catch (\Exception $exception) {
            $this->eventRecorder->eraseEvents();

            throw $exception;
        }

        $recordedEvents = $this->eventRecorder->releaseEvents();

        foreach ($recordedEvents as $event) {
            $this->eventDispatcher->dispatch($event);
        }

        return $result;
    }
515953
public function execute($command, callable $next)
    {
        if (! $command instanceof NamedCommand) {
            throw new \InvalidArgumentException('Command must be a NamedCommand');
        }

        $this->queuePublisher->publish($this->serializer->serialize($command), $command->getCommandName());
    }
1289044
public function execute($command, callable $next)
    {
        $this->connection->beginTransaction();

        try {
            $returnValue = $next($command);

            $this->connection->commit();
        } catch (Exception $exception) {
            $this->connection->rollBack();

            throw $exception;
        } catch (Throwable $exception) {
            $this->connection->rollBack();

            throw $exception;
        }

        return $returnValue;
    }