src/Uri.php
protected function withString ($string, $name = 'query')
    {
        if (!is_string($string) && !method_exists($string, '__toString')) {
            throw new InvalidArgumentException('Uri fragment must be a string');
        }
        $string = ltrim((string) $string, '#');
        $clone = clone $this;
        $clone->$name = $this->filterQuery($string);

        return $clone;
    }
protected function withString ($string, $name = 'query')
    {
        if (!is_string($string) && !method_exists($string, '__toString')) {
            throw new InvalidArgumentException('Uri fragment must be a string');
        }
        $string = ltrim((string) $string, '#');
        $clone = clone $this;
        $clone->$name = $this->filterQuery($string);

        return $clone;
    }
protected function withString ( $ string , $ name = 'query' ) { if ( ! is_string ( $ string ) && ! method_exists ( $ string , '__toString' ) ) { throw new InvalidArgumentException ( 'Uri fragment must be a string' ) ; } $ string = ltrim ( ( string ) $ string , '#' ) ; $ clone = clone $ this ; $ clone -> $ name = $ this -> filterQuery ( $ string ) ; return $ clone ; }
withString function.

@access protected
@param string $string
@param string $name (default: 'query')
@return Uri
withString function .