Skip to content

Commit 07f9071

Browse files
authored
Change private to protected in the InMemory adapter (#69)
Signed-off-by: Giuseppe Rota <[email protected]>
1 parent 6e30c28 commit 07f9071

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/Prometheus/Storage/InMemory.php

+14-14
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ class InMemory implements Adapter
1414
/**
1515
* @var mixed[]
1616
*/
17-
private $counters = [];
17+
protected $counters = [];
1818

1919
/**
2020
* @var mixed[]
2121
*/
22-
private $gauges = [];
22+
protected $gauges = [];
2323

2424
/**
2525
* @var mixed[]
2626
*/
27-
private $histograms = [];
27+
protected $histograms = [];
2828

2929
/**
3030
* @var mixed[]
3131
*/
32-
private $summaries = [];
32+
protected $summaries = [];
3333

3434
/**
3535
* @return MetricFamilySamples[]
@@ -65,7 +65,7 @@ public function wipeStorage(): void
6565
/**
6666
* @return MetricFamilySamples[]
6767
*/
68-
private function collectHistograms(): array
68+
protected function collectHistograms(): array
6969
{
7070
$histograms = [];
7171
foreach ($this->histograms as $histogram) {
@@ -140,7 +140,7 @@ private function collectHistograms(): array
140140
/**
141141
* @return MetricFamilySamples[]
142142
*/
143-
private function collectSummaries(): array
143+
protected function collectSummaries(): array
144144
{
145145
$math = new Math();
146146
$summaries = [];
@@ -216,7 +216,7 @@ private function collectSummaries(): array
216216
* @param mixed[] $metrics
217217
* @return MetricFamilySamples[]
218218
*/
219-
private function internalCollect(array $metrics): array
219+
protected function internalCollect(array $metrics): array
220220
{
221221
$result = [];
222222
foreach ($metrics as $metric) {
@@ -358,7 +358,7 @@ public function updateCounter(array $data): void
358358
*
359359
* @return string
360360
*/
361-
private function histogramBucketValueKey(array $data, $bucket): string
361+
protected function histogramBucketValueKey(array $data, $bucket): string
362362
{
363363
return implode(':', [
364364
$data['type'],
@@ -373,7 +373,7 @@ private function histogramBucketValueKey(array $data, $bucket): string
373373
*
374374
* @return string
375375
*/
376-
private function metaKey(array $data): string
376+
protected function metaKey(array $data): string
377377
{
378378
return implode(':', [
379379
$data['type'],
@@ -387,7 +387,7 @@ private function metaKey(array $data): string
387387
*
388388
* @return string
389389
*/
390-
private function valueKey(array $data): string
390+
protected function valueKey(array $data): string
391391
{
392392
return implode(':', [
393393
$data['type'],
@@ -402,7 +402,7 @@ private function valueKey(array $data): string
402402
*
403403
* @return mixed[]
404404
*/
405-
private function metaData(array $data): array
405+
protected function metaData(array $data): array
406406
{
407407
$metricsMetaData = $data;
408408
unset($metricsMetaData['value'], $metricsMetaData['command'], $metricsMetaData['labelValues']);
@@ -412,7 +412,7 @@ private function metaData(array $data): array
412412
/**
413413
* @param mixed[] $samples
414414
*/
415-
private function sortSamples(array &$samples): void
415+
protected function sortSamples(array &$samples): void
416416
{
417417
usort($samples, function ($a, $b): int {
418418
return strcmp(implode("", $a['labelValues']), implode("", $b['labelValues']));
@@ -424,7 +424,7 @@ private function sortSamples(array &$samples): void
424424
* @return string
425425
* @throws RuntimeException
426426
*/
427-
private function encodeLabelValues(array $values): string
427+
protected function encodeLabelValues(array $values): string
428428
{
429429
$json = json_encode($values);
430430
if (false === $json) {
@@ -438,7 +438,7 @@ private function encodeLabelValues(array $values): string
438438
* @return mixed[]
439439
* @throws RuntimeException
440440
*/
441-
private function decodeLabelValues(string $values): array
441+
protected function decodeLabelValues(string $values): array
442442
{
443443
$json = base64_decode($values, true);
444444
if (false === $json) {

0 commit comments

Comments
 (0)