Skip to content
This repository was archived by the owner on Oct 22, 2019. It is now read-only.

Commit 127aa91

Browse files
authored
Merge pull request #46 from crazycodr/master
Fix incorrect cast after json_decode
2 parents 30fd249 + b8ad3cf commit 127aa91

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/Prometheus/Sample.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ public function getName()
3131
*/
3232
public function getLabelNames()
3333
{
34-
return $this->labelNames;
34+
return (array)$this->labelNames;
3535
}
3636

3737
/**
3838
* @return array
3939
*/
4040
public function getLabelValues()
4141
{
42-
return $this->labelValues;
42+
return (array)$this->labelValues;
4343
}
4444

4545
/**

src/Prometheus/Storage/Redis.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ private function collectGauges()
283283
$gauge['samples'][] = array(
284284
'name' => $gauge['name'],
285285
'labelNames' => array(),
286-
'labelValues' => json_decode($k),
286+
'labelValues' => json_decode($k, true),
287287
'value' => $value
288288
);
289289
}
@@ -309,7 +309,7 @@ private function collectCounters()
309309
$counter['samples'][] = array(
310310
'name' => $counter['name'],
311311
'labelNames' => array(),
312-
'labelValues' => json_decode($k),
312+
'labelValues' => json_decode($k, true),
313313
'value' => $value
314314
);
315315
}

0 commit comments

Comments
 (0)