use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\KernelInterface;
+use Symfony\Component\Stopwatch\Stopwatch;
/**
* TimeDataCollector.
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;
if (null !== $this->kernel) {
$startTime = $this->kernel->getStartTime();
} else {
- $startTime = $request->server->get('REQUEST_TIME_FLOAT', $request->server->get('REQUEST_TIME'));
+ $startTime = $request->server->get('REQUEST_TIME_FLOAT');
}
$this->data = array(
);
}
+ /**
+ * {@inheritdoc}
+ */
+ public function reset()
+ {
+ $this->data = array();
+
+ if (null !== $this->stopwatch) {
+ $this->stopwatch->reset();
+ }
+ }
+
/**
* {@inheritdoc}
*/