| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | 2 | public function createLoggers(array $config): array |
|
| 17 | { |
||
| 18 | 2 | $logChannels = []; |
|
| 19 | |||
| 20 | 2 | if (!array_key_exists('channels', $config)) { |
|
| 21 | 1 | throw new InvalidArgumentException('You must have a channels array config'); |
|
| 22 | } |
||
| 23 | |||
| 24 | 1 | foreach ($config['channels'] as $name => $path) { |
|
| 25 | 1 | $logger = new Logger($name); |
|
| 26 | 1 | $logger->pushHandler(new StreamHandler($path, Logger::DEBUG)); |
|
| 27 | 1 | $logChannels[$name] = $logger; |
|
| 28 | } |
||
| 29 | |||
| 30 | 1 | return $logChannels; |
|
| 31 | } |
||
| 32 | |||
| 33 | } |