Merge branch '1.x' into 2.x

* 1.x:
  fixed CS
  Disable xdebug var_dump overload for tests
  Prepare for the new serialization mechanism
This commit is contained in:
Fabien Potencier
2019-04-07 18:41:26 +02:00
2 changed files with 19 additions and 2 deletions
+1
View File
@@ -19,6 +19,7 @@
<php>
<ini name="error_reporting" value="-1" />
<ini name="xdebug.overload_var_dump" value="0" />
</php>
<listeners>
+18 -2
View File
@@ -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;
}
}