| Total Complexity | 4 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 77.78% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | abstract class Counter extends Metric implements Incrementable |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * {@inheritdoc} |
||
| 15 | */ |
||
| 16 | 6 | final public function builder(Collection $items): SamplesBuilder |
|
| 17 | { |
||
| 18 | 6 | return new CounterSamplesBuilder($this, $items); |
|
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * {@inheritdoc} |
||
| 23 | */ |
||
| 24 | 6 | final public function type(): string |
|
| 25 | { |
||
| 26 | 6 | return 'counter'; |
|
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * {@inheritdoc} |
||
| 31 | */ |
||
| 32 | public function increment(array $labels): self |
||
| 33 | { |
||
| 34 | return $this->incrementBy(1, $labels); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * {@inheritdoc} |
||
| 39 | */ |
||
| 40 | 5 | public function incrementBy(float $value, array $labels): self |
|
| 45 | } |
||
| 46 | } |
||
| 47 |