GW2Treasures / gw2api

Wrapper for the Guild Wars 2 API in PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add /v2/guild/:id/upgrades endpoint

darthmaim opened this issue · comments

  • /v2/guild/:id/upgrades (#80)

an endpoint upgrade is already existent (/v2/guild/upgrades).
how can I name this one ?

I'd say we move all the /v2/guild/:id/xxx endpoints in their own namespace (GW2Treasures\GW2Api\V2\Endpoint\Guild\{Authenticated,Details,Info,?}). Not sure about the exact name for it yet.

I'm gonna go with Authenticated for the moment (looks fine for me).
It's just a namespace, it's not gonna hard break everything else if we decide to change it later!

It was a nice idea but we get another problem :


/**
     * Get guild upgrades.
     *
     * @return UpgradeEndpoint
     */
    public function upgrades() {
        return new UpgradeEndpoint($this->api);
    }

We need an other name to discern $api->guild()->upgrades() from $api->guild()->upgrades?($id)

Uggh. I didn't think about that... I'd say just name it $api->guild()->upgradesOf($id).

Mabye this would be a good naming pattern for all x/:id/y endpoints (inventoryOf($characterId), membersOf($guildId), ...). The next version is a new major anyway because of some other breaking changes (PvPEndpoint is no longer authenticated), so we could do this now.

Yeh I like this naming pattern!
I'm gonna do like this for this issue and create an issue for the other endpoints.