Skip to content

Commit ee5b7ee

Browse files
committed
Prepare for the new serialization mechanism
1 parent ded8491 commit ee5b7ee

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Tests/Fixtures/CustomArrayObject.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,23 @@ public function count()
5858
return \count($this->array);
5959
}
6060

61+
public function __serialize(): array
62+
{
63+
return $this->array;
64+
}
65+
6166
public function serialize()
6267
{
63-
return serialize($this->array);
68+
return serialize($this->__serialize());
69+
}
70+
71+
public function __unserialize(array $data): void
72+
{
73+
$this->array = $data;
6474
}
6575

6676
public function unserialize($serialized)
6777
{
68-
$this->array = (array) unserialize((string) $serialized);
78+
$this->__unserialize((array) unserialize((string) $serialized));
6979
}
7080
}

0 commit comments

Comments
 (0)