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