diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php index b50386cb96..f9730b1485 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php @@ -164,6 +164,16 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface } } + public function reset() + { + $this->stopwatch->reset(); + $this->data = array(); + $this->dataCount = 0; + $this->isCollected = false; + $this->clonesCount = 0; + $this->clonesIndex = 0; + } + public function serialize() { if ($this->clonesCount !== $this->clonesIndex) { diff --git a/src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php index 6588304935..e489d77598 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php @@ -14,6 +14,7 @@ namespace Symfony\Component\HttpKernel\DataCollector; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; +use Symfony\Component\Stopwatch\Stopwatch; /** * TimeDataCollector. @@ -25,7 +26,7 @@ class TimeDataCollector extends DataCollector implements LateDataCollectorInterf protected $kernel; protected $stopwatch; - public function __construct(KernelInterface $kernel = null, $stopwatch = null) + public function __construct(KernelInterface $kernel = null, Stopwatch $stopwatch = null) { $this->kernel = $kernel; $this->stopwatch = $stopwatch; @@ -55,6 +56,10 @@ class TimeDataCollector extends DataCollector implements LateDataCollectorInterf public function reset() { $this->data = array(); + + if (null !== $this->stopwatch) { + $this->stopwatch->reset(); + } } /**