[HttpKernel] Tweak the Profile class - DRY

This commit is contained in:
Victor Berchet 2012-01-25 13:25:50 +01:00
parent 06da573d04
commit 3bcd154a6c

View File

@ -18,7 +18,7 @@ use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface;
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Profile implements \Serializable
class Profile
{
private $token;
private $collectors;
@ -212,13 +212,8 @@ class Profile implements \Serializable
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));
}
public function unserialize($data)
{
list($this->token, $this->parent, $this->children, $this->collectors, $this->ip, $this->method, $this->url, $this->time) = unserialize($data);
return array('token', 'parent', 'children', 'collectors', 'ip', 'method', 'url', 'time');
}
}