meilisearch-php icon indicating copy to clipboard operation
meilisearch-php copied to clipboard

Typehint: Index instead of Indexes

Open tacman opened this issue 6 months ago • 2 comments

Description

It has always felt unnatural for the index to be called Indexes.

We could deprecate the plural in version 1 and have version 2 return just Index.

OLD:

    public function getIndex(string $indexCode): Indexes
    {
        return $this->client->index($indexCode);
    }

NEW:

    public function getIndex(string $indexCode): Index
    {
        return $this->client->index($indexCode);
    }

tacman avatar Jun 02 '25 13:06 tacman

Thanks for opening an issue!

I agree with this proposal. WDYT @brunoocasali @norkunas?

Feel free to open a PR to address this. :)

Strift avatar Jun 04 '25 04:06 Strift

Sounds reasonable

norkunas avatar Jun 04 '25 04:06 norkunas