Conditions | 4 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function run() |
||
33 | { |
||
34 | $measurements = $this->container['config']->get('measurement.measurements', []); |
||
35 | $store = $this->container['measurement.store']; |
||
36 | |||
37 | foreach ($measurements as $measurement) { |
||
38 | $type = array_get($measurement, 'type'); |
||
39 | $key = array_get($measurement, 'key'); |
||
40 | |||
41 | if (!$type || !$key) { |
||
42 | $message = 'The measurement configuration needs at least a type and a key'; |
||
43 | throw new MeasurementConfigurationError($message); |
||
44 | } |
||
45 | |||
46 | $runner = $this->types[$type]; |
||
47 | |||
48 | $runner->run($store, $measurement); |
||
49 | } |
||
50 | } |
||
51 | } |
||
52 |