implement reset() in DumpDataCollector
This commit is contained in:
parent
6231acc8e8
commit
cd602d691a
@ -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) {
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user