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;
}