Skip to content

Commit

Permalink
[VarDumper] dont implement Serializable in Stub
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Jan 29, 2019
1 parent 3cfb558 commit 73070d7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Symfony/Component/VarDumper/Cloner/Stub.php
Expand Up @@ -16,7 +16,7 @@
*
* @author Nicolas Grekas <p@tchwork.com>
*/
class Stub implements \Serializable
class Stub
{
const TYPE_REF = 1;
const TYPE_STRING = 2;
Expand All @@ -42,16 +42,19 @@ class Stub implements \Serializable
/**
* @internal
*/
public function serialize()
public function __sleep()
{
return \serialize([$this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr]);
$this->serialized = [$this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr];

return ['serialized'];
}

/**
* @internal
*/
public function unserialize($serialized)
public function __wakeup()
{
list($this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr) = \unserialize($serialized);
list($this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr) = $this->serialized;
unset($this->serialized);
}
}

0 comments on commit 73070d7

Please sign in to comment.