src/Anshar/Http/Uri.php
public function withAuthority($authority)
    {
        $with_authority = new Authority($authority);

        $new_authority_uri = clone $this;

        $new_authority_uri->authority = $with_authority;

        $new_authority_uri->user_info = $with_authority->getUserInfo();
        $new_authority_uri->host      = $with_authority->getHost();
        $new_authority_uri->port      = $with_authority->getPort();

        return $new_authority_uri;
    }
public function withAuthority($authority)
    {
        $with_authority = new Authority($authority);

        $new_authority_uri = clone $this;

        $new_authority_uri->authority = $with_authority;

        $new_authority_uri->user_info = $with_authority->getUserInfo();
        $new_authority_uri->host      = $with_authority->getHost();
        $new_authority_uri->port      = $with_authority->getPort();

        return $new_authority_uri;
    }
public function withAuthority ( $ authority ) { $ with_authority = new Authority ( $ authority ) ; $ new_authority_uri = clone $ this ; $ new_authority_uri -> authority = $ with_authority ; $ new_authority_uri -> user_info = $ with_authority -> getUserInfo ( ) ; $ new_authority_uri -> host = $ with_authority -> getHost ( ) ; $ new_authority_uri -> port = $ with_authority -> getPort ( ) ; return $ new_authority_uri ; }
Return an instance with the specified authority.

This method MUST retain the state of the current instance, and return
an instance that contains the specified authority.

Replacing the authority is equivalent to replacing or removing all authority components depending upon the
composition of the authority.

An empty authority is equivalent to removing the authority and all authority components.

@param string $authority The scheme to use with the new instance.
@return static A new instance with the specified authority.
@throws \InvalidArgumentException for invalid authorities.
Return an instance with the specified authority .