private function validateUrl()
    {
        $urlData = parse_url($this->val());

        if(!$urlData || !$this->isArray($urlData)) {
            throw new UrlObjectException(UrlObjectException::MSG_INVALID_URL, [$this->val()]);
        }

        // extract parts
        $urlData = $this->arr($urlData);

        // scheme
        $this->scheme = $urlData->key('scheme', '', true);
        // host
        $this->host = $urlData->key('host', '', true);
        // port
        $this->port = $urlData->key('port', '', true);
        // path
        $this->path = $urlData->key('path', '', true);

        // parse query string
        if($urlData->keyExists('query')) {
            parse_str($urlData->key('query'), $queryData);
            if($this->isArray($queryData)) {
                $this->query = $queryData;
            }
        }
    }