Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / http-kernel / DataCollector / MemoryDataCollector.php
index 93850108444a0d136bf3bb260b9f3ddc32e90fd0..8d8cc1a04d1818d7cfaa0f83fd3ca5c1d6fea81a 100644 (file)
@@ -23,10 +23,7 @@ class MemoryDataCollector extends DataCollector implements LateDataCollectorInte
 {
     public function __construct()
     {
-        $this->data = array(
-            'memory' => 0,
-            'memory_limit' => $this->convertToBytes(ini_get('memory_limit')),
-        );
+        $this->reset();
     }
 
     /**
@@ -37,6 +34,17 @@ class MemoryDataCollector extends DataCollector implements LateDataCollectorInte
         $this->updateMemoryUsage();
     }
 
+    /**
+     * {@inheritdoc}
+     */
+    public function reset()
+    {
+        $this->data = array(
+            'memory' => 0,
+            'memory_limit' => $this->convertToBytes(ini_get('memory_limit')),
+        );
+    }
+
     /**
      * {@inheritdoc}
      */
@@ -99,8 +107,11 @@ class MemoryDataCollector extends DataCollector implements LateDataCollectorInte
 
         switch (substr($memoryLimit, -1)) {
             case 't': $max *= 1024;
+            // no break
             case 'g': $max *= 1024;
+            // no break
             case 'm': $max *= 1024;
+            // no break
             case 'k': $max *= 1024;
         }