diff options
Diffstat (limited to 'includes/libs')
-rw-r--r-- | includes/libs/Stats/Metrics/BaseMetricInterface.php | 5 | ||||
-rw-r--r-- | includes/libs/Stats/Sample.php | 4 | ||||
-rw-r--r-- | includes/libs/Stats/StatsFactory.php | 13 | ||||
-rw-r--r-- | includes/libs/Stats/StatsUtils.php | 24 |
4 files changed, 4 insertions, 42 deletions
diff --git a/includes/libs/Stats/Metrics/BaseMetricInterface.php b/includes/libs/Stats/Metrics/BaseMetricInterface.php index f3113619e76a..611f54d1c1e6 100644 --- a/includes/libs/Stats/Metrics/BaseMetricInterface.php +++ b/includes/libs/Stats/Metrics/BaseMetricInterface.php @@ -156,8 +156,9 @@ interface BaseMetricInterface { /** * StatsD Data Factory instance to copy metrics to. * - * @param IBufferingStatsdDataFactory $statsdDataFactory + * @param IBufferingStatsdDataFactory|null $statsdDataFactory + * * @return BaseMetricInterface */ - public function withStatsdDataFactory( IBufferingStatsdDataFactory $statsdDataFactory ); + public function withStatsdDataFactory( ?IBufferingStatsdDataFactory $statsdDataFactory ); } diff --git a/includes/libs/Stats/Sample.php b/includes/libs/Stats/Sample.php index 9796882a1d22..5ce07f1285db 100644 --- a/includes/libs/Stats/Sample.php +++ b/includes/libs/Stats/Sample.php @@ -22,8 +22,6 @@ declare( strict_types=1 ); namespace Wikimedia\Stats; /** - * Sample Data Class - * * A container for a metric sample to be passed to the rendering function. * * @author Cole White @@ -33,8 +31,6 @@ class Sample { /** @var string[] */ private array $labelValues; - - /** @var float */ private float $value; /** diff --git a/includes/libs/Stats/StatsFactory.php b/includes/libs/Stats/StatsFactory.php index 7e09ca9d63de..b24d540fe86d 100644 --- a/includes/libs/Stats/StatsFactory.php +++ b/includes/libs/Stats/StatsFactory.php @@ -35,9 +35,7 @@ use Wikimedia\Stats\Metrics\NullMetric; use Wikimedia\Stats\Metrics\TimingMetric; /** - * StatsFactory Implementation - * - * This is the primary interface for validating metrics definitions + * This is the primary interface for validating metrics definitions, * caching defined metrics, and returning metric instances from cache * if previously defined. * @@ -46,19 +44,10 @@ use Wikimedia\Stats\Metrics\TimingMetric; */ class StatsFactory { - /** @var string */ private string $component; - - /** @var StatsCache */ private StatsCache $cache; - - /** @var EmitterInterface */ private EmitterInterface $emitter; - - /** @var LoggerInterface */ private LoggerInterface $logger; - - /** @var IBufferingStatsdDataFactory|null */ private ?IBufferingStatsdDataFactory $statsdDataFactory = null; /** diff --git a/includes/libs/Stats/StatsUtils.php b/includes/libs/Stats/StatsUtils.php index 7d0ec292b1fd..7ecbcef8d36a 100644 --- a/includes/libs/Stats/StatsUtils.php +++ b/includes/libs/Stats/StatsUtils.php @@ -25,9 +25,6 @@ use InvalidArgumentException; use Wikimedia\Stats\Exceptions\InvalidConfigurationException; /** - * - * StatsUtils Implementation - * * Functionality common to all metric types. * * @author Cole White @@ -112,27 +109,6 @@ class StatsUtils { } /** - * Merges two associative arrays of labels. Prioritizes leftmost labels. - * - * @param array $leftLabels - * @param array $rightLabels - * @return array - */ - public static function mergeLabels( array $leftLabels, array $rightLabels ): array { - $output = []; - foreach ( $leftLabels as $key => $value ) { - $output[$key] = $value; - } - foreach ( $rightLabels as $key => $value ) { - if ( array_key_exists( $key, $output ) ) { - continue; - } - $output[$key] = $value; - } - return $output; - } - - /** * Normalize an array of strings. * * @param string[] $entities |