Larabros\Elogram\Http\UrlParserTrait::getPath PHP Method

getPath() public method

Gets the path from a UriInterface instance after removing the version prefix.
public getPath ( Psr\Http\Message\UriInterface $uri ) : string
$uri Psr\Http\Message\UriInterface
return string
    public function getPath(UriInterface $uri)
    {
        $path = trim($uri->getPath(), '/');
        $parts = explode('/', $path);
        if ($parts[0] === 'v' . Client::API_VERSION) {
            unset($parts[0]);
        }
        return '/' . implode('/', $parts);
    }