| Conditions | 4 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | private function getTrackingId(ServiceLocatorInterface $serviceLocator): string |
||
| 20 | { |
||
| 21 | if (!$serviceLocator->has('config')) { |
||
| 22 | return ''; |
||
| 23 | } |
||
| 24 | $config = $serviceLocator->get('Config'); |
||
| 25 | if (!isset($config['google_analytics']['tracking_id']) || !is_string($config['google_analytics']['tracking_id'])) { |
||
| 26 | return ''; |
||
| 27 | } |
||
| 28 | return $config['google_analytics']['tracking_id']; |
||
| 29 | } |
||
| 30 | } |
||
| 31 |