Skip to content

deprecated para php 8.2 en ModelsBase.php #4

@upadrian

Description

@upadrian

Instanciando la sdk en un nuevo proyecto, con php 8.2, me dice:

E_DEPRECATED: Return type of Plexo\Sdk\Models\ModelsBase::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

/vendor/plexophp/php-sdk/src/Models/ModelsBase.php

La primera solución sería agregar para cada método declarado, una atributo declarativo.
En vez de:
public function offsetGet($offset) { return $this->__get($offset); }
agregar
#[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->__get($offset); }
Esto no es una solución definitiva, ya que habría que declarar explicitamente el return value de cada método (mixed, int, etc...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions