diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c321f2bcb..0ca6827d5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -19,6 +19,7 @@ + diff --git a/src/Profiler/Profile.php b/src/Profiler/Profile.php index 3e1230509..bac6d2b26 100644 --- a/src/Profiler/Profile.php +++ b/src/Profiler/Profile.php @@ -164,12 +164,28 @@ class Profile implements \IteratorAggregate, \Serializable public function serialize() { - return serialize([$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles]); + return serialize($this->__serialize()); } public function unserialize($data) { - list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = unserialize($data); + $this->__unserialize(unserialize($data)); + } + + /** + * @internal + */ + public function __serialize() + { + return [$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles]; + } + + /** + * @internal + */ + public function __unserialize(array $data) + { + list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = $data; } }