src/Viserio/Component/Bus/Dispatcher.php
public function dispatch($command, Closure $afterResolving = null)
    {
        return $this->pipeline->send($command)->through($this->pipes)->then(function ($command) use ($afterResolving) {
            if (\method_exists($command, $this->method)) {
                return $this->getInvoker()->call([$command, $this->method]);
            }

            $handler = $this->resolveHandler($command);

            if ($afterResolving !== null) {
                $afterResolving($handler);
            }

            return $handler->{$this->getHandlerMethod($command)}($command);
        });
    }
public function dispatch($command, Closure $afterResolving = null)
    {
        return $this->pipeline->send($command)->through($this->pipes)->then(function ($command) use ($afterResolving) {
            if (\method_exists($command, $this->method)) {
                return $this->getInvoker()->call([$command, $this->method]);
            }

            $handler = $this->resolveHandler($command);

            if ($afterResolving !== null) {
                $afterResolving($handler);
            }

            return $handler->{$this->getHandlerMethod($command)}($command);
        });
    }
{@inheritdoc}