Completed
Push — master ( 3c7a07...1bc614 )
by Philip
01:56
created

AbstractStorage::storeMeasurement()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 1
nc 1
1
<?php
2
3
/*
4
 * This file is part of the PHPProm package.
5
 *
6
 * (c) Philip Lehmann-Böhm <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace PHPProm\Storage;
13
14
abstract class AbstractStorage {
15
16
    protected $availableMetrics;
17
18
    public function __construct() {
19
        $this->availableMetrics = [];
20
    }
21
22
    public function addAvailableMetric($storagePrefix, $metric, $label, $help, $type, $defaultValue) {
23
        $this->availableMetrics[] = [
24
            'storagePrefix' => $storagePrefix,
25
            'metric' => $metric,
26
            'label' => $label,
27
            'help' => $help,
28
            'type' => $type,
29
            'defaultValue' => $defaultValue
30
        ];
31
    }
32
33
    public function getAvailableMetrics() {
34
        return $this->availableMetrics;
35
    }
36
37
    abstract public function storeMeasurement($prefix, $key, $value);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
38
39
    abstract public function incrementMeasurement($prefix, $key);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
40
41
    abstract public function getMeasurements($prefix, array $keys, $defaultValue = 'Nan');
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
42
43
}
44