protected function cleanPath($uri)
    {
        $urlPath = parse_url($uri, PHP_URL_PATH);
        $uri     = str_replace('v1/', '', $urlPath);
        $path    = preg_replace('/(\/\w{10}$|self|\d*)/', '', $uri);
        return trim(preg_replace('/\/{1,2}|\-/', '_', $path), '_');
    }
protected function cleanPath($uri)
    {
        $urlPath = parse_url($uri, PHP_URL_PATH);
        $uri     = str_replace('v1/', '', $urlPath);
        $path    = preg_replace('/(\/\w{10}$|self|\d*)/', '', $uri);
        return trim(preg_replace('/\/{1,2}|\-/', '_', $path), '_');
    }
protected function cleanPath ( $ uri ) { $ urlPath = parse_url ( $ uri , PHP_URL_PATH ) ; $ uri = str_replace ( 'v1/' , '' , $ urlPath ) ; $ path = preg_replace ( '/(\/\w{10}$|self|\d*)/' , '' , $ uri ) ; return trim ( preg_replace ( '/\/{1,2}|\-/' , '_' , $ path ) , '_' ) ; }
Removes any unwanted suffixes and values from a URL path.

@param $uri

@return string
Removes any unwanted suffixes and values from a URL path .