Larabros\Elogram\Http\Clients\MockAdapter::cleanPath PHP Method

cleanPath() protected method

Removes any unwanted suffixes and values from a URL path.
protected cleanPath ( $uri ) : string
$uri
return string
    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), '_');
    }