[HttpKernel] Tweak the Profile class - DRY
This commit is contained in:
parent
06da573d04
commit
3bcd154a6c
@ -18,7 +18,7 @@ use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface;
|
|||||||
*
|
*
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
*/
|
*/
|
||||||
class Profile implements \Serializable
|
class Profile
|
||||||
{
|
{
|
||||||
private $token;
|
private $token;
|
||||||
private $collectors;
|
private $collectors;
|
||||||
@ -212,13 +212,8 @@ class Profile implements \Serializable
|
|||||||
return isset($this->collectors[$name]);
|
return isset($this->collectors[$name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function serialize()
|
public function __sleep()
|
||||||
{
|
{
|
||||||
return serialize(array($this->token, $this->parent, $this->children, $this->collectors, $this->ip, $this->method, $this->url, $this->time));
|
return array('token', 'parent', 'children', 'collectors', 'ip', 'method', 'url', 'time');
|
||||||
}
|
|
||||||
|
|
||||||
public function unserialize($data)
|
|
||||||
{
|
|
||||||
list($this->token, $this->parent, $this->children, $this->collectors, $this->ip, $this->method, $this->url, $this->time) = unserialize($data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user