protected function setAuthority($authority)
    {
        $aparts = [];
        if (preg_match('/^(([^\@]+)\@)?(.*?)(\:(.+))?$/S', $authority, $aparts)) {
            $this->authority = $authority;

            $this->hash = null;

            if (isset($aparts[2]) && $aparts[2]) {
                $this->userInfo = $aparts[2];
            }
            if (isset($aparts[3]) && $aparts[3]) {
                $this->host = $aparts[3];
            }
            if (isset($aparts[5]) && $aparts[5]) {
                $this->port = (int)$aparts[5];
            }
        } else {
            throw new \DomainException("Hierarchical URL authority part syntax error");
        }

        return $this;
    }