Skip to content
Snippets Groups Projects
Commit 072bc39c authored by Daniel Kurowski's avatar Daniel Kurowski
Browse files

implement magic serializable methods

parent 666b5fd0
No related branches found
No related tags found
1 merge request!26Upgrade deps and ci image
Pipeline #38291 passed
......@@ -167,6 +167,14 @@ namespace Grifart\Collection {
}
public function __unserialize(array $data): void
{
[$values, $keys] = $data;
$this->values = $values;
$this->keys = $keys;
}
public function serialize(): string
{
return \serialize([
......@@ -176,6 +184,15 @@ namespace Grifart\Collection {
}
public function __serialize(): array
{
return [
$this->values,
$this->keys,
];
}
//<editor-fold desc="\ArrayAccess interface">
public function offsetExists($key): bool
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment