| Conditions | 3 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | public function register(DiInterface $di): void |
||
| 35 | { |
||
| 36 | $configPath = '/etc/inc/mikopbx-settings.json'; |
||
| 37 | |||
| 38 | if ( ! file_exists($configPath) |
||
| 39 | || ! is_readable($configPath) |
||
| 40 | ) { |
||
| 41 | throw new Exception('Config file does not exist: ' . $configPath); |
||
| 42 | } |
||
| 43 | |||
| 44 | $di->setShared( |
||
| 45 | self::SERVICE_NAME, |
||
| 46 | function () use ($configPath) { |
||
| 47 | return new Json($configPath); |
||
| 48 | } |
||
| 61 | } |