@@ -58,7 +58,7 @@ |
||
| 58 | 58 | $finalizer->shouldReceive('addFinalizer')->once(); |
| 59 | 59 | |
| 60 | 60 | $container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 61 | - new class() implements LoaderInterface { |
|
| 61 | + new class() implements LoaderInterface{ |
|
| 62 | 62 | public function has(string $section): bool |
| 63 | 63 | { |
| 64 | 64 | return false; |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $finalizer->shouldReceive('addFinalizer')->once(); |
| 41 | 41 | |
| 42 | 42 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 43 | - new class() implements LoaderInterface { |
|
| 43 | + new class() implements LoaderInterface{ |
|
| 44 | 44 | public function has(string $section): bool |
| 45 | 45 | { |
| 46 | 46 | return false; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $container = new Container(); |
| 54 | 54 | $container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 55 | - new class() implements LoaderInterface { |
|
| 55 | + new class() implements LoaderInterface{ |
|
| 56 | 56 | public function has(string $section): bool |
| 57 | 57 | { |
| 58 | 58 | return false; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | $container = new Container(); |
| 81 | 81 | $container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 82 | - new class() implements LoaderInterface { |
|
| 82 | + new class() implements LoaderInterface{ |
|
| 83 | 83 | public function has(string $section): bool |
| 84 | 84 | { |
| 85 | 85 | return false; |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | $finalizer->shouldReceive('addFinalizer')->once(); |
| 33 | 33 | |
| 34 | 34 | $container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 35 | - new class() implements LoaderInterface { |
|
| 35 | + new class() implements LoaderInterface{ |
|
| 36 | 36 | public function has(string $section): bool |
| 37 | 37 | { |
| 38 | 38 | return false; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $finalizer->shouldReceive('addFinalizer')->once(); |
| 33 | 33 | |
| 34 | 34 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
| 35 | - new class() implements LoaderInterface { |
|
| 35 | + new class() implements LoaderInterface{ |
|
| 36 | 36 | public function has(string $section): bool |
| 37 | 37 | { |
| 38 | 38 | return false; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | ] |
| 84 | 84 | ])); |
| 85 | 85 | |
| 86 | - $logger = $this->container->get(LogsInterface::class)->getLogger('test');; |
|
| 86 | + $logger = $this->container->get(LogsInterface::class)->getLogger('test'); ; |
|
| 87 | 87 | |
| 88 | 88 | $this->assertCount(1, $logger->getProcessors()); |
| 89 | 89 | $this->assertInstanceOf(PsrLogMessageProcessor::class, $logger->getProcessors()[0]); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | MonologConfig $config, |
| 52 | 52 | ListenerRegistryInterface $listenerRegistry, |
| 53 | 53 | FactoryInterface $factory |
| 54 | - ) { |
|
| 54 | + ){ |
|
| 55 | 55 | $this->config = $config; |
| 56 | 56 | $this->factory = $factory; |
| 57 | 57 | $this->eventHandler = new EventHandler($listenerRegistry, $config->getEventLevel()); |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function getLogger(string $channel = null): LoggerInterface |
| 64 | 64 | { |
| 65 | - if ($channel === null || $channel == self::DEFAULT) { |
|
| 66 | - if ($this->default !== null) { |
|
| 65 | + if ($channel === null || $channel == self::DEFAULT){ |
|
| 66 | + if ($this->default !== null){ |
|
| 67 | 67 | // we should use only one default logger per system |
| 68 | 68 | return $this->default; |
| 69 | 69 | } |
@@ -104,15 +104,15 @@ discard block |
||
| 104 | 104 | // always include default handler |
| 105 | 105 | $handlers = []; |
| 106 | 106 | |
| 107 | - foreach ($this->config->getHandlers($channel) as $handler) { |
|
| 108 | - if (! $handler instanceof Autowire) { |
|
| 107 | + foreach ($this->config->getHandlers($channel) as $handler){ |
|
| 108 | + if (!$handler instanceof Autowire){ |
|
| 109 | 109 | $handlers[] = $handler; |
| 110 | 110 | continue; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - try { |
|
| 113 | + try{ |
|
| 114 | 114 | $handlers[] = $handler->resolve($this->factory); |
| 115 | - } catch (ContainerExceptionInterface $e) { |
|
| 115 | + }catch (ContainerExceptionInterface $e){ |
|
| 116 | 116 | throw new ConfigException($e->getMessage(), $e->getCode(), $e); |
| 117 | 117 | } |
| 118 | 118 | } |
@@ -131,20 +131,20 @@ discard block |
||
| 131 | 131 | protected function getProcessors(string $channel): array |
| 132 | 132 | { |
| 133 | 133 | $processors = []; |
| 134 | - foreach ($this->config->getProcessors($channel) as $processor) { |
|
| 135 | - if (! $processor instanceof Autowire) { |
|
| 134 | + foreach ($this->config->getProcessors($channel) as $processor){ |
|
| 135 | + if (!$processor instanceof Autowire){ |
|
| 136 | 136 | $processors[] = $processor; |
| 137 | 137 | continue; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - try { |
|
| 140 | + try{ |
|
| 141 | 141 | $processors[] = $processor->resolve($this->factory); |
| 142 | - } catch (ContainerExceptionInterface $e) { |
|
| 142 | + }catch (ContainerExceptionInterface $e){ |
|
| 143 | 143 | throw new ConfigException($e->getMessage(), $e->getCode(), $e); |
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - if ($processors === []) { |
|
| 147 | + if ($processors === []){ |
|
| 148 | 148 | $processors[] = new PsrLogMessageProcessor(); |
| 149 | 149 | } |
| 150 | 150 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | public function reset() |
| 155 | 155 | { |
| 156 | - if ($this->default instanceof ResettableInterface) { |
|
| 156 | + if ($this->default instanceof ResettableInterface){ |
|
| 157 | 157 | $this->default->reset(); |
| 158 | 158 | } |
| 159 | 159 | } |
@@ -48,18 +48,18 @@ discard block |
||
| 48 | 48 | public function boot(Container $container, FinalizerInterface $finalizer): void |
| 49 | 49 | { |
| 50 | 50 | $finalizer->addFinalizer(static function () use ($container): void { |
| 51 | - if ($container->hasInstance(LoggerInterface::class)) { |
|
| 51 | + if ($container->hasInstance(LoggerInterface::class)){ |
|
| 52 | 52 | $logger = $container->get(LoggerInterface::class); |
| 53 | 53 | |
| 54 | - if ($logger instanceof ResettableInterface) { |
|
| 54 | + if ($logger instanceof ResettableInterface){ |
|
| 55 | 55 | $logger->reset(); |
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if ($container->hasInstance(LogsInterface::class)) { |
|
| 59 | + if ($container->hasInstance(LogsInterface::class)){ |
|
| 60 | 60 | $factory = $container->get(LogsInterface::class); |
| 61 | 61 | |
| 62 | - if ($factory instanceof ResettableInterface) { |
|
| 62 | + if ($factory instanceof ResettableInterface){ |
|
| 63 | 63 | $factory->reset(); |
| 64 | 64 | } |
| 65 | 65 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | { |
| 78 | 78 | $name = MonologConfig::CONFIG; |
| 79 | 79 | |
| 80 | - if (! isset($this->config->getConfig($name)['handlers'][$channel])) { |
|
| 80 | + if (!isset($this->config->getConfig($name)['handlers'][$channel])){ |
|
| 81 | 81 | $this->config->modify($name, new Append('handlers', $channel, [])); |
| 82 | 82 | } |
| 83 | 83 | |