| Conditions | 3 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function __invoke( |
||
| 29 | ContainerInterface $container, |
||
| 30 | string $requestedName, |
||
| 31 | array $options = null |
||
| 32 | ): SyslogHandler { |
||
| 33 | $options = $options ?? $this->getServiceOptions($container, $requestedName); |
||
| 34 | |||
| 35 | $ident = $options['ident'] ?? ''; |
||
| 36 | if (empty($ident)) { |
||
| 37 | throw new ServiceNotCreatedException( |
||
| 38 | sprintf('The required \'ident\' configuration option is missing for service \'%s\'', $requestedName) |
||
| 39 | ); |
||
| 40 | } |
||
| 41 | |||
| 42 | return new SyslogHandler( |
||
| 43 | $ident, |
||
| 44 | $options['facility'] ?? LOG_USER, |
||
| 45 | $options['level'] ?? Logger::DEBUG, |
||
| 46 | isset($options['bubble']) ? (bool)$options['bubble'] : true, |
||
| 47 | $options['logopts'] ?? LOG_PID |
||
| 48 | ); |
||
| 51 |