meilisearch / meilisearch-php

PHP wrapper for the Meilisearch API

Home Page:https://meilisearch.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add @return mixed to remove deprecation warning

tacman opened this issue · comments

[deprecation] User Deprecated: Method "ArrayAccess::offsetGet()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Meilisearch\Contracts\Data" now to avoid errors or add an explicit @return annotation to suppress this message. ["exception" => ErrorException { …}]

Is there any downside to adding @return mixed to this method? Alas, php7.4 doesn't support return type mixed.

    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        if (isset($this->data[$offset])) {
            return $this->data[$offset];
        }

        return null;
    }

It seems to be fixed after #508 let me know @tacman :)