| Conditions | 5 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public function createService(ServiceLocatorInterface $serviceLocator) |
||
| 27 | { |
||
| 28 | /** @var ModuleOptions $moduleOptions */ |
||
| 29 | $config = $serviceLocator->get('Config'); |
||
| 30 | |||
| 31 | if (!isset($config['axalian_achievements'])) { |
||
| 32 | throw new RuntimeException('No valid "axalian_achievements" config set'); |
||
| 33 | } |
||
| 34 | |||
| 35 | if (!isset($config['axalian_achievements']['achievement_providers'])) { |
||
| 36 | throw new RuntimeException('No valid "achievement_providers" config set in "axalian_achievements"'); |
||
| 37 | } |
||
| 38 | |||
| 39 | if (!isset($config['axalian_achievements']['storage_adapter']) || |
||
| 40 | empty($config['axalian_achievements']['storage_adapter']) |
||
| 41 | ) { |
||
| 42 | throw new RuntimeException('No valid "storage_adapter" config set in "axalian_achievements"'); |
||
| 43 | } |
||
| 44 | |||
| 45 | return new ModuleOptions($config['axalian_achievements']); |
||
| 46 | } |
||
| 47 | } |
||
| 48 |