Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incubator-mongodb implements Serializable which is deprecated in php8.1 #975

Closed
noone-silent opened this issue Nov 8, 2023 · 1 comment
Assignees

Comments

@noone-silent
Copy link

noone-silent commented Nov 8, 2023

See https://www.php.net/manual/en/class.serializable It throws a lot of deprecation warnings

Solution:

  1. Create version 3.0 for php8.1+
  2. Remove interface Serializable and add __serialize and __unserialize
    public function __serialize(): array
    {
        return $this->toArray();
    }

    public function __unserialize(array $data): void
    {
        $this->assign($data);
    }

Please note that __serialize() ha to return an array not ?string!

@Jeckerson
Copy link
Member

Fixed in v2.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants