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