1 | <?php |
||
14 | abstract class AbstractStorage { |
||
15 | |||
16 | protected $availableMetrics; |
||
17 | |||
18 | public function __construct() { |
||
21 | |||
22 | public function addAvailableMetric($storagePrefix, $metric, $label, $help, $type, $defaultValue) { |
||
32 | |||
33 | public function getAvailableMetrics() { |
||
36 | |||
37 | abstract public function storeMeasurement($prefix, $key, $value); |
||
38 | |||
39 | abstract public function incrementMeasurement($prefix, $key); |
||
40 | |||
41 | abstract public function getMeasurements($prefix, array $keys, $defaultValue = 'Nan'); |
||
42 | |||
43 | } |
||
44 |
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.