@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | private readonly MonologConfig $config, |
| 33 | 33 | ListenerRegistryInterface $listenerRegistry, |
| 34 | 34 | private readonly FactoryInterface $factory |
| 35 | - ) { |
|
| 35 | + ){ |
|
| 36 | 36 | $this->eventHandler = new EventHandler($listenerRegistry, $config->getEventLevel()); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | { |
| 41 | 41 | $default = $this->config->getDefault(); |
| 42 | 42 | |
| 43 | - if ($channel === null || $channel === $default) { |
|
| 44 | - if ($this->default !== null) { |
|
| 43 | + if ($channel === null || $channel === $default){ |
|
| 44 | + if ($this->default !== null){ |
|
| 45 | 45 | // we should use only one default logger per system |
| 46 | 46 | return $this->default; |
| 47 | 47 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | public function createInjection( |
| 64 | 64 | \ReflectionClass $class, |
| 65 | - \ReflectionParameter|null|string $context = null |
|
| 65 | + \ReflectionParameter | null | string $context = null |
|
| 66 | 66 | ): LoggerInterface { |
| 67 | 67 | $channel = \is_object($context) ? $this->extractChannelAttribute($context) : null; |
| 68 | 68 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | public function reset(): void |
| 74 | 74 | { |
| 75 | - if ($this->default instanceof ResettableInterface) { |
|
| 75 | + if ($this->default instanceof ResettableInterface){ |
|
| 76 | 76 | $this->default->reset(); |
| 77 | 77 | } |
| 78 | 78 | } |
@@ -88,15 +88,15 @@ discard block |
||
| 88 | 88 | // always include default handler |
| 89 | 89 | $handlers = []; |
| 90 | 90 | |
| 91 | - foreach ($this->config->getHandlers($channel) as $handler) { |
|
| 92 | - if (!$handler instanceof Autowire) { |
|
| 91 | + foreach ($this->config->getHandlers($channel) as $handler){ |
|
| 92 | + if (!$handler instanceof Autowire){ |
|
| 93 | 93 | $handlers[] = $handler; |
| 94 | 94 | continue; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - try { |
|
| 97 | + try{ |
|
| 98 | 98 | $handlers[] = $handler->resolve($this->factory); |
| 99 | - } catch (ContainerExceptionInterface $e) { |
|
| 99 | + }catch (ContainerExceptionInterface $e){ |
|
| 100 | 100 | throw new ConfigException($e->getMessage(), $e->getCode(), $e); |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -114,20 +114,20 @@ discard block |
||
| 114 | 114 | protected function getProcessors(string $channel): array |
| 115 | 115 | { |
| 116 | 116 | $processors = []; |
| 117 | - foreach ($this->config->getProcessors($channel) as $processor) { |
|
| 118 | - if (!$processor instanceof Autowire) { |
|
| 117 | + foreach ($this->config->getProcessors($channel) as $processor){ |
|
| 118 | + if (!$processor instanceof Autowire){ |
|
| 119 | 119 | $processors[] = $processor; |
| 120 | 120 | continue; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - try { |
|
| 123 | + try{ |
|
| 124 | 124 | $processors[] = $processor->resolve($this->factory); |
| 125 | - } catch (ContainerExceptionInterface $e) { |
|
| 125 | + }catch (ContainerExceptionInterface $e){ |
|
| 126 | 126 | throw new ConfigException($e->getMessage(), $e->getCode(), $e); |
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - if ($processors === []) { |
|
| 130 | + if ($processors === []){ |
|
| 131 | 131 | $processors[] = new PsrLogMessageProcessor(); |
| 132 | 132 | } |
| 133 | 133 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $logger = $factory->getLogger(); |
| 56 | 56 | |
| 57 | 57 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 58 | - new class() implements LoaderInterface { |
|
| 58 | + new class() implements LoaderInterface{ |
|
| 59 | 59 | public function has(string $section): bool |
| 60 | 60 | { |
| 61 | 61 | return false; |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $this->container->get(StrategyBasedBootloadManager::class)->bootload([MonologBootloader::class]); |
| 86 | 86 | $this->container->bind(LogFactory::class, $factory); |
| 87 | 87 | |
| 88 | - $this->container->invoke(function (#[LoggerChannel('foo')] LoggerInterface $logger) { |
|
| 88 | + $this->container->invoke(function (#[LoggerChannel('foo')] LoggerInterface $logger){ |
|
| 89 | 89 | $this->assertSame('foo', $logger->getName()); |
| 90 | 90 | }); |
| 91 | 91 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | public function testFinalizerShouldResetDefaultLogger() |
| 94 | 94 | { |
| 95 | 95 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 96 | - new class() implements LoaderInterface { |
|
| 96 | + new class() implements LoaderInterface{ |
|
| 97 | 97 | public function has(string $section): bool |
| 98 | 98 | { |
| 99 | 99 | return false; |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | public function testFinalizerShouldNotResetLoggerWhenApplicationTerminating() |
| 134 | 134 | { |
| 135 | 135 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 136 | - new class() implements LoaderInterface { |
|
| 136 | + new class() implements LoaderInterface{ |
|
| 137 | 137 | public function has(string $section): bool |
| 138 | 138 | { |
| 139 | 139 | return false; |
@@ -55,7 +55,8 @@ discard block |
||
| 55 | 55 | $logger = $factory->getLogger(); |
| 56 | 56 | |
| 57 | 57 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 58 | - new class() implements LoaderInterface { |
|
| 58 | + new class() implements LoaderInterface |
|
| 59 | + { |
|
| 59 | 60 | public function has(string $section): bool |
| 60 | 61 | { |
| 61 | 62 | return false; |
@@ -85,7 +86,8 @@ discard block |
||
| 85 | 86 | $this->container->get(StrategyBasedBootloadManager::class)->bootload([MonologBootloader::class]); |
| 86 | 87 | $this->container->bind(LogFactory::class, $factory); |
| 87 | 88 | |
| 88 | - $this->container->invoke(function (#[LoggerChannel('foo')] LoggerInterface $logger) { |
|
| 89 | + $this->container->invoke(function (#[LoggerChannel('foo')] LoggerInterface $logger) |
|
| 90 | + { |
|
| 89 | 91 | $this->assertSame('foo', $logger->getName()); |
| 90 | 92 | }); |
| 91 | 93 | } |
@@ -93,7 +95,8 @@ discard block |
||
| 93 | 95 | public function testFinalizerShouldResetDefaultLogger() |
| 94 | 96 | { |
| 95 | 97 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 96 | - new class() implements LoaderInterface { |
|
| 98 | + new class() implements LoaderInterface |
|
| 99 | + { |
|
| 97 | 100 | public function has(string $section): bool |
| 98 | 101 | { |
| 99 | 102 | return false; |
@@ -133,7 +136,8 @@ discard block |
||
| 133 | 136 | public function testFinalizerShouldNotResetLoggerWhenApplicationTerminating() |
| 134 | 137 | { |
| 135 | 138 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 136 | - new class() implements LoaderInterface { |
|
| 139 | + new class() implements LoaderInterface |
|
| 140 | + { |
|
| 137 | 141 | public function has(string $section): bool |
| 138 | 142 | { |
| 139 | 143 | return false; |