@@ -42,22 +42,27 @@ discard block |
||
| 42 | 42 | public function init(Container $container, FinalizerInterface $finalizer): void |
| 43 | 43 | { |
| 44 | 44 | $finalizer->addFinalizer(static function (bool $terminate) use ($container): void { |
| 45 | - if ($terminate) { |
|
| 45 | + if ($terminate) |
|
| 46 | + { |
|
| 46 | 47 | return; |
| 47 | 48 | } |
| 48 | 49 | |
| 49 | - if ($container->hasInstance(LoggerInterface::class)) { |
|
| 50 | + if ($container->hasInstance(LoggerInterface::class)) |
|
| 51 | + { |
|
| 50 | 52 | $logger = $container->get(LoggerInterface::class); |
| 51 | 53 | |
| 52 | - if ($logger instanceof ResettableInterface) { |
|
| 54 | + if ($logger instanceof ResettableInterface) |
|
| 55 | + { |
|
| 53 | 56 | $logger->reset(); |
| 54 | 57 | } |
| 55 | 58 | } |
| 56 | 59 | |
| 57 | - if ($container->hasInstance(LogsInterface::class)) { |
|
| 60 | + if ($container->hasInstance(LogsInterface::class)) |
|
| 61 | + { |
|
| 58 | 62 | $factory = $container->get(LogsInterface::class); |
| 59 | 63 | |
| 60 | - if ($factory instanceof ResettableInterface) { |
|
| 64 | + if ($factory instanceof ResettableInterface) |
|
| 65 | + { |
|
| 61 | 66 | $factory->reset(); |
| 62 | 67 | } |
| 63 | 68 | } |
@@ -74,7 +79,8 @@ discard block |
||
| 74 | 79 | |
| 75 | 80 | public function addHandler(string $channel, HandlerInterface $handler): void |
| 76 | 81 | { |
| 77 | - if (!isset($this->config->getConfig(MonologConfig::CONFIG)['handlers'][$channel])) { |
|
| 82 | + if (!isset($this->config->getConfig(MonologConfig::CONFIG)['handlers'][$channel])) |
|
| 83 | + { |
|
| 78 | 84 | $this->config->modify(MonologConfig::CONFIG, new Append('handlers', $channel, [])); |
| 79 | 85 | } |
| 80 | 86 | |