Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 7
CRAP
0.00% covered (danger)
0.00%
0 / 1
MockMetrics
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 7
56
0.00% covered (danger)
0.00%
0 / 1
 timing
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 gauge
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 set
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 increment
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 decrement
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 updateCount
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 produceStatsdData
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2declare( strict_types = 1 );
3
4namespace Wikimedia\Parsoid\Mocks;
5
6use Liuggio\StatsdClient\Entity\StatsdDataInterface;
7use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
8
9class MockMetrics implements StatsdDataFactoryInterface {
10
11    /** @var array */
12    public $log;
13
14    /** @inheritDoc */
15    public function timing( $key, $time ) {
16        $this->log[] = [ 'timing', $key, $time ];
17    }
18
19    /** @inheritDoc */
20    public function gauge( $key, $value ) {
21        $this->log[] = [ 'gauge', $key, $value ];
22    }
23
24    /** @inheritDoc */
25    public function set( $key, $value ) {
26        $this->log[] = [ 'set', $key, $value ];
27        return [];
28    }
29
30    /** @inheritDoc */
31    public function increment( $key ) {
32        $this->log[] = [ 'increment', $key ];
33        return [];
34    }
35
36    /** @inheritDoc */
37    public function decrement( $key ) {
38        $this->log[] = [ 'decrement', $key ];
39        return [];
40    }
41
42    /** @inheritDoc */
43    public function updateCount( $key, $delta ) {
44        $this->log[] = [ 'updateCount', $key, $delta ];
45        return [];
46    }
47
48    /** @inheritDoc */
49    public function produceStatsdData(
50        $key, $value = 1, $metric = StatsdDataInterface::STATSD_METRIC_COUNT
51    ) {
52        // @phan-suppress-next-line PhanTypeMismatchReturn FIXME, phan seems right
53        return $metric;
54    }
55
56}