From 3bcd154a6c907379c635d0ac4b20de2184d1d602 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Wed, 25 Jan 2012 13:25:50 +0100 Subject: [PATCH] [HttpKernel] Tweak the Profile class - DRY --- src/Symfony/Component/HttpKernel/Profiler/Profile.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Profiler/Profile.php b/src/Symfony/Component/HttpKernel/Profiler/Profile.php index 5caf97b71e..bed24f1d10 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/Profile.php +++ b/src/Symfony/Component/HttpKernel/Profiler/Profile.php @@ -18,7 +18,7 @@ use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface; * * @author Fabien Potencier */ -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'); } }