X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Flibs%2Fstats%2FBufferingStatsdDataFactory.php;h=5ef01350d820f67b68e877c31e29f0236448beae;hb=fad1d907606517e0e31ffbca69273d1351479031;hp=d75d9c0b1ec7b6e9ee71ea3a4b27a98d4bf1e859;hpb=3f1a52805e3cf801eda0357ee236de6b49a31c85;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/stats/BufferingStatsdDataFactory.php b/includes/libs/stats/BufferingStatsdDataFactory.php index d75d9c0b1e..5ef01350d8 100644 --- a/includes/libs/stats/BufferingStatsdDataFactory.php +++ b/includes/libs/stats/BufferingStatsdDataFactory.php @@ -92,34 +92,34 @@ class BufferingStatsdDataFactory extends StatsdDataFactory implements IBuffering } /** - * @deprecated Use getData() + * @deprecated since 1.30 Use getData() instead * @return StatsdData[] */ public function getBuffer() { + wfDeprecated( __METHOD__, '1.30' ); return $this->buffer; } - /** - * Check whether this data factory has any data. - * @return bool - */ public function hasData() { return !empty( $this->buffer ); } /** - * Return data from the factory. + * @since 1.30 * @return StatsdData[] */ public function getData() { return $this->buffer; } - /** - * Set collection enable status. - * @param bool $enabled Will collection be enabled? - * @return void - */ + public function clearData() { + $this->buffer = []; + } + + public function getDataCount() { + return count( $this->buffer ); + } + public function setEnabled( $enabled ) { $this->enabled = $enabled; }