public function setURL($url)
    {
        if (!$this->validateURL($url)) {
            throw new \InvalidArgumentException(sprintf('The URL "%s" is invalid.', $url));
        }

        $this->url = $url;
        $this->endpoint = null;
    }