We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23e6389 commit 7aea656Copy full SHA for 7aea656
src/Metric.php
@@ -33,7 +33,7 @@ abstract class Metric {
33
*
34
* @var \PNX\Prometheus\LabelledValue[]
35
*/
36
- protected $labelledValues;
+ protected $labelledValues = [];
37
38
/**
39
* Metric constructor.
tests/Unit/GaugeTest.php
@@ -35,4 +35,15 @@ public function testGauge() {
}
+ /**
+ * Ensure a gauge with no values is valid.
40
+ *
41
+ * @covers ::__construct
42
+ * @covers ::getLabelledValues
43
+ */
44
+ public function testGaugeNoValues() {
45
+ $gauge = new Gauge("foo", "bar", "A test gauge");
46
+ $this->assertEmpty($gauge->getLabelledValues());
47
+ }
48
+
49
0 commit comments