Conditions | 3 |
Paths | 4 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function __invoke(array $options) |
||
13 | { |
||
14 | $batchMode = (int) ($options['batchMode'] ?? JsonFormatter::BATCH_MODE_JSON); |
||
15 | $appendNewline = (boolean) ($options['appendNewline'] ?? true); |
||
16 | $hostmane = (string) ($options['hostname'] ?? ''); |
||
17 | $appName = (string) ($options['appName'] ?? ''); |
||
18 | |||
19 | $formatter = new LogmaticFormatter($batchMode, $appendNewline); |
||
20 | |||
21 | if (!empty($hostmane)) { |
||
22 | $formatter->setHostname($hostmane); |
||
23 | } |
||
24 | |||
25 | if (!empty($appName)) { |
||
26 | $formatter->setAppname($appName); |
||
27 | } |
||
28 | |||
29 | return $formatter; |
||
30 | } |
||
31 | } |
||
32 |