diff vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
line wrap: on
line diff
--- a/vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php	Mon Apr 23 09:33:26 2018 +0100
+++ b/vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php	Mon Apr 23 09:46:53 2018 +0100
@@ -14,6 +14,7 @@
 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 @@
     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;
@@ -39,7 +40,7 @@
         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(
@@ -52,6 +53,18 @@
     /**
      * {@inheritdoc}
      */
+    public function reset()
+    {
+        $this->data = array();
+
+        if (null !== $this->stopwatch) {
+            $this->stopwatch->reset();
+        }
+    }
+
+    /**
+     * {@inheritdoc}
+     */
     public function lateCollect()
     {
         if (null !== $this->stopwatch && isset($this->data['token'])) {