lib/Uri.php
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;
    }
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;
    }
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 ; }
Set authority component of this URI.

@param string $authority The decoded authority component of this URI, or null if the authority is undefined.
@throws \DomainException
@return Uri
Set authority component of this URI .