public function execute($command, callable $next)
    {
        if (!self::$active) {
            return $next($command);
        }

        if ($command instanceof HandleBacklogElementCommand) {
            $command = $command->getPayload();

            return $next($command);
        }

        if ($command instanceof CommandInterface) {
            $this->backlogService->enqueue($command);

            $this->logCommandEnqueued($command);

            return true;
        }

        return $next($command);
    }
public function execute($command, callable $next)
    {
        if (!self::$active) {
            return $next($command);
        }

        if ($command instanceof HandleBacklogElementCommand) {
            $command = $command->getPayload();

            return $next($command);
        }

        if ($command instanceof CommandInterface) {
            $this->backlogService->enqueue($command);

            $this->logCommandEnqueued($command);

            return true;
        }

        return $next($command);
    }
{@inheritdoc}