protected function versionPath(string $uri)
    {
        if ($this->version === null || preg_match(self::VERSION_PATTERN, $uri)) {
            // No version set, or already versioned... nothing to do
            return $uri;
        }

        // Graph request
        if ($this->isGraphRequest($uri)) {
            return str_replace('/admin/api', "/admin/api/{$this->version}", $uri);
        }

        // REST request
        return preg_replace('/\/admin(\/api)?\//', "/admin/api/{$this->version}/", $uri);
    }
protected function versionPath(string $uri)
    {
        if ($this->version === null || preg_match(self::VERSION_PATTERN, $uri)) {
            // No version set, or already versioned... nothing to do
            return $uri;
        }

        // Graph request
        if ($this->isGraphRequest($uri)) {
            return str_replace('/admin/api', "/admin/api/{$this->version}", $uri);
        }

        // REST request
        return preg_replace('/\/admin(\/api)?\//', "/admin/api/{$this->version}/", $uri);
    }
protected function versionPath ( string $ uri ) { if ( $ this -> version === null || preg_match ( self :: VERSION_PATTERN , $ uri ) ) { // No version set, or already versioned... nothing to do return $ uri ; } // Graph request if ( $ this -> isGraphRequest ( $ uri ) ) { return str_replace ( '/admin/api' , "/admin/api/{$this->version}" , $ uri ) ; } // REST request return preg_replace ( '/\/admin(\/api)?\//' , "/admin/api/{$this->version}/" , $ uri ) ; }
Versions the API call with the set version.

@param string $uri

@return string
Versions the API call with the set version .