| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | public function collect(): array |
||
| 25 | { |
||
| 26 | if (!file_exists(self::INI_FILE)) return []; |
||
| 27 | |||
| 28 | $config = file(self::INI_FILE); |
||
| 29 | |||
| 30 | $configArray = []; |
||
| 31 | |||
| 32 | foreach ($config as $line) { |
||
| 33 | if (str_starts_with('[', $line)) continue; |
||
| 34 | $element = explode('=', $line); |
||
| 35 | $configArray[$element[0]] = $element[1]; |
||
| 36 | } |
||
| 37 | |||
| 38 | return [ |
||
| 39 | 'server' => $configArray['server'], |
||
| 40 | 'user' => $configArray['user'] |
||
| 41 | ]; |
||
| 44 |