| Total Complexity | 4 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | class Gauge implements RAWMetrics, HMRegistry, Telemetry |
||
| 20 | { |
||
| 21 | use Named, Labeled, VExporter, Reporting; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var float |
||
| 25 | */ |
||
| 26 | private $value = 0; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Gauge constructor. |
||
| 30 | * @param float $initial |
||
| 31 | */ |
||
| 32 | public function __construct(float $initial = 0) |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param float $v |
||
| 39 | * @return float |
||
| 40 | */ |
||
| 41 | public function inc(float $v = 1) : float |
||
| 42 | { |
||
| 43 | return $this->value += $v; |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @param float $v |
||
| 48 | * @return float |
||
| 49 | */ |
||
| 50 | public function dec(float $v = 1) : float |
||
| 51 | { |
||
| 52 | return $this->value -= $v; |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param float $v |
||
| 57 | * @return float |
||
| 58 | */ |
||
| 59 | public function set(float $v) : float |
||
| 62 | } |
||
| 63 | } |
||
| 64 |