UrlToQueryItem.php
private function parseUrl( $url = '', Array $query_string_vars = [ ] ) {
        parse_str( parse_url( $url, PHP_URL_QUERY ), $this->query_string );
        $request_uri = trim( parse_url( $url, PHP_URL_PATH ), '/' );
        $this->request = trim( preg_replace( '#^/*index\.php#', '', $request_uri ), '/' );
        if ( ! empty( $query_string_vars ) ) {
            $this->query_string = array_merge( $this->query_string, $query_string_vars );
        }
    }
private function parseUrl( $url = '', Array $query_string_vars = [ ] ) {
        parse_str( parse_url( $url, PHP_URL_QUERY ), $this->query_string );
        $request_uri = trim( parse_url( $url, PHP_URL_PATH ), '/' );
        $this->request = trim( preg_replace( '#^/*index\.php#', '', $request_uri ), '/' );
        if ( ! empty( $query_string_vars ) ) {
            $this->query_string = array_merge( $this->query_string, $query_string_vars );
        }
    }
private function parseUrl ( $ url = '' , Array $ query_string_vars = [ ] ) { parse_str ( parse_url ( $ url , PHP_URL_QUERY ) , $ this -> query_string ) ; $ request_uri = trim ( parse_url ( $ url , PHP_URL_PATH ) , '/' ) ; $ this -> request = trim ( preg_replace ( '#^/*index\.php#' , '' , $ request_uri ) , '/' ) ; if ( ! empty ( $ query_string_vars ) ) { $ this -> query_string = array_merge ( $ this -> query_string , $ query_string_vars ) ; } }
Parse the url to be resolved taking only relative part and stripping out query vars.

@param type string
@param array $query_string_vars
Parse the url to be resolved taking only relative part and stripping out query vars .