| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 19 | public function createService(ServiceLocatorInterface $serviceLocator) |
||
| 20 | { |
||
| 21 | $config = $serviceLocator->get('Config'); |
||
| 22 | $collectorServiceName = $config['phpab']['analytics']['collector']; |
||
| 23 | |||
| 24 | if (!$serviceLocator->has($collectorServiceName)) { |
||
| 25 | throw new RuntimeException(sprintf( |
||
| 26 | 'The data collector "%s" does not exists.', |
||
| 27 | $config['phpab']['analytics']['collector'] |
||
| 28 | )); |
||
| 29 | } |
||
| 30 | |||
| 31 | $analyticsData = $serviceLocator->get($collectorServiceName); |
||
| 32 | |||
| 33 | return new GoogleUniversalAnalytics($analyticsData->getTestsData()); |
||
| 34 | } |
||
| 35 | } |
||
| 36 |