Skip to content

Commit

Permalink
Add missing methods
Browse files Browse the repository at this point in the history
"Warning
 As of PHP 8.1.0, a class which implements Serializable without also implementing __serialize() and __unserialize() will generate a deprecation warning."
 https://www.php.net/manual/en/class.serializable.php
  • Loading branch information
Jeckerson committed Dec 30, 2023
1 parent d183a63 commit a621cef
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Mvc/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1516,4 +1516,14 @@ public function jsonSerialize(): array

return $data;
}

public function __serialize(): array
{
return $this->toArray();
}

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

0 comments on commit a621cef

Please sign in to comment.