| 1 | <?php |
||
| 8 | class Metrics implements \JsonSerializable |
||
| 9 | { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @var array |
||
| 13 | */ |
||
| 14 | private $data = []; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param $metric |
||
| 18 | * @return $this |
||
| 19 | */ |
||
| 20 | public function attach($metric) |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param $key |
||
| 28 | * @return null |
||
| 29 | */ |
||
| 30 | public function get($key) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param $key |
||
| 37 | * @return bool |
||
| 38 | */ |
||
| 39 | public function has($key) |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return array |
||
| 46 | */ |
||
| 47 | public function all() |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @inheritdoc |
||
| 54 | */ |
||
| 55 | function jsonSerialize() |
||
| 59 | } |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.