public function return($result)
    {
        if (!$result instanceof ResponseInterface && !is_callable($result)) {
            throw InvalidArgumentException::withExpectedType(
                $this,
                'return',
                1,
                sprintf('an instance of %s or a callable', ResponseInterface::class),
                $result
            );
        }

        $this->result = $result;

        return $this;
    }