Merge "Don't hard-code Preferences page name"
[lhc/web/wiklou.git] / includes / libs / stats / NullStatsdDataFactory.php
index fee792f..7369751 100644 (file)
@@ -8,7 +8,7 @@ use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
  * @author Addshore
  * @since 1.27
  */
-class NullStatsdDataFactory implements StatsdDataFactoryInterface {
+class NullStatsdDataFactory implements IBufferingStatsdDataFactory {
 
        /**
         * This function creates a 'timing' StatsdData.
@@ -53,7 +53,6 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface {
         * This function creates a 'increment' StatsdData object.
         *
         * @param string|array $key The metric(s) to increment.
-        * @param float|1      $sampleRate The rate (0-1) for sampling.
         *
         * @return array
         */
@@ -66,7 +65,6 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface {
         *
         *
         * @param string|array $key The metric(s) to decrement.
-        * @param float|1      $sampleRate The rate (0-1) for sampling.
         *
         * @return mixed
         */
@@ -78,7 +76,7 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface {
         * This function creates a 'updateCount' StatsdData object.
         *
         * @param string|array $key The metric(s) to decrement.
-        * @param integer $delta The delta to add to the each metric
+        * @param int $delta The delta to add to the each metric
         *
         * @return mixed
         */
@@ -108,4 +106,28 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface {
                return $data;
        }
 
+       /**
+        * Check whether this data factory has any data.
+        * @return bool
+        */
+       public function hasData() {
+               return false;
+       }
+
+       /**
+        * Return data from the factory.
+        * @return StatsdData[]
+        */
+       public function getData() {
+               return [];
+       }
+
+       /**
+        * Set collection enable status.
+        * @param bool $enabled Will collection be enabled?
+        * @return void
+        */
+       public function setEnabled( $enabled ) {
+               // Nothing to do, null factory is always disabled.
+       }
 }