src/Url.php
public function withQueryString(?string $queryString = null): UrlInterface
    {
        if (!self::myValidateQueryString($queryString, $error)) {
            throw new UrlInvalidArgumentException($error);
        }

        return new self($this->myScheme, $this->myHost, $this->myPort, $this->myPath, $queryString, $this->myFragment);
    }
public function withQueryString(?string $queryString = null): UrlInterface
    {
        if (!self::myValidateQueryString($queryString, $error)) {
            throw new UrlInvalidArgumentException($error);
        }

        return new self($this->myScheme, $this->myHost, $this->myPort, $this->myPath, $queryString, $this->myFragment);
    }
public function withQueryString ( ? string $ queryString = null ) : UrlInterface { if ( ! self :: myValidateQueryString ( $ queryString , $ error ) ) { throw new UrlInvalidArgumentException ( $ error ) ; } return new self ( $ this -> myScheme , $ this -> myHost , $ this -> myPort , $ this -> myPath , $ queryString , $ this -> myFragment ) ; }
Returns a copy of the Url instance with the specified query string.

@since 1.0.0

@param string|null $queryString The query string or null for no query string.

@throws UrlInvalidArgumentException If the query parameter is invalid.

@return UrlInterface The url instance.
Returns a copy of the Url instance with the specified query string .