Conditions | 1 |
Paths | 1 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function __invoke(array $options) |
||
17 | { |
||
18 | $handler = $this->getHandlerManager()->get($options['handler']); |
||
19 | $thresholdMap = [ |
||
20 | Logger::DEBUG => $options['thresholdMap']['debug'] ?? 0, |
||
21 | Logger::INFO => $options['thresholdMap']['info'] ?? 0, |
||
22 | Logger::NOTICE => $options['thresholdMap']['notice'] ?? 0, |
||
23 | Logger::WARNING => $options['thresholdMap']['warning'] ?? 0, |
||
24 | Logger::ERROR => $options['thresholdMap']['error'] ?? 0, |
||
25 | Logger::CRITICAL => $options['thresholdMap']['critical'] ?? 0, |
||
26 | Logger::ALERT => $options['thresholdMap']['alert'] ?? 0, |
||
27 | Logger::EMERGENCY => $options['thresholdMap']['emergency'] ?? 0, |
||
28 | ]; |
||
29 | |||
30 | $level = (int) ($options['level'] ?? Logger::DEBUG); |
||
31 | $bubble = (boolean) ($options['bubble'] ?? true); |
||
32 | |||
33 | return new OverflowHandler( |
||
34 | $handler, |
||
35 | $thresholdMap, |
||
36 | $level, |
||
37 | $bubble |
||
38 | ); |
||
39 | } |
||
40 | } |
||
41 |