@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | MonologConfig $config, |
51 | 51 | ListenerRegistryInterface $listenerRegistry, |
52 | 52 | FactoryInterface $factory |
53 | - ) { |
|
53 | + ){ |
|
54 | 54 | $this->config = $config; |
55 | 55 | $this->factory = $factory; |
56 | 56 | $this->eventHandler = new EventHandler($listenerRegistry, $config->getEventLevel()); |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function getLogger(string $channel = null): LoggerInterface |
63 | 63 | { |
64 | - if ($channel === null || $channel == self::DEFAULT) { |
|
65 | - if ($this->default !== null) { |
|
64 | + if ($channel === null || $channel == self::DEFAULT){ |
|
65 | + if ($this->default !== null){ |
|
66 | 66 | // we should use only one default logger per system |
67 | 67 | return $this->default; |
68 | 68 | } |
@@ -103,15 +103,15 @@ discard block |
||
103 | 103 | // always include default handler |
104 | 104 | $handlers = []; |
105 | 105 | |
106 | - foreach ($this->config->getHandlers($channel) as $handler) { |
|
107 | - if (!$handler instanceof Autowire) { |
|
106 | + foreach ($this->config->getHandlers($channel) as $handler){ |
|
107 | + if (!$handler instanceof Autowire){ |
|
108 | 108 | $handlers[] = $handler; |
109 | 109 | continue; |
110 | 110 | } |
111 | 111 | |
112 | - try { |
|
112 | + try{ |
|
113 | 113 | $handlers[] = $handler->resolve($this->factory); |
114 | - } catch (ContainerExceptionInterface $e) { |
|
114 | + }catch (ContainerExceptionInterface $e){ |
|
115 | 115 | throw new ConfigException($e->getMessage(), $e->getCode(), $e); |
116 | 116 | } |
117 | 117 | } |
@@ -64,12 +64,12 @@ |
||
64 | 64 | */ |
65 | 65 | public function addHandler(string $channel, HandlerInterface $handler): void |
66 | 66 | { |
67 | - if (!isset($this->config->getConfig('monolog')['handlers'][$channel])) { |
|
67 | + if (!isset($this->config->getConfig('monolog')['handlers'][$channel])){ |
|
68 | 68 | $this->config->modify('monolog', new Append('handlers', $channel, [])); |
69 | 69 | } |
70 | 70 | |
71 | 71 | $this->config->modify('monolog', new Append( |
72 | - 'handlers.' . $channel, |
|
72 | + 'handlers.'.$channel, |
|
73 | 73 | null, |
74 | 74 | $handler |
75 | 75 | )); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | ListenerRegistryInterface $listenerRegistry, |
31 | 31 | int $level = Logger::DEBUG, |
32 | 32 | bool $bubble = true |
33 | - ) { |
|
33 | + ){ |
|
34 | 34 | $this->listenerRegistry = $listenerRegistry; |
35 | 35 | |
36 | 36 | parent::__construct($level, $bubble); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $record['context'] |
51 | 51 | ); |
52 | 52 | |
53 | - foreach ($this->listenerRegistry->getListeners() as $listener) { |
|
53 | + foreach ($this->listenerRegistry->getListeners() as $listener){ |
|
54 | 54 | call_user_func($listener, $e); |
55 | 55 | } |
56 | 56 | } |
@@ -42,18 +42,18 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function getHandlers(string $channel): \Generator |
44 | 44 | { |
45 | - if (empty($this->config['handlers'][$channel])) { |
|
45 | + if (empty($this->config['handlers'][$channel])){ |
|
46 | 46 | return; |
47 | 47 | } |
48 | 48 | |
49 | - foreach ($this->config['handlers'][$channel] as $handler) { |
|
50 | - if (is_object($handler) && !$handler instanceof Autowire) { |
|
49 | + foreach ($this->config['handlers'][$channel] as $handler){ |
|
50 | + if (is_object($handler) && !$handler instanceof Autowire){ |
|
51 | 51 | yield $handler; |
52 | 52 | continue; |
53 | 53 | } |
54 | 54 | |
55 | 55 | $wire = $this->wire($channel, $handler); |
56 | - if (!empty($wire)) { |
|
56 | + if (!empty($wire)){ |
|
57 | 57 | yield $wire; |
58 | 58 | } |
59 | 59 | } |
@@ -68,15 +68,15 @@ discard block |
||
68 | 68 | */ |
69 | 69 | private function wire(string $channel, $handler): ?Autowire |
70 | 70 | { |
71 | - if ($handler instanceof Autowire) { |
|
71 | + if ($handler instanceof Autowire){ |
|
72 | 72 | return $handler; |
73 | 73 | } |
74 | 74 | |
75 | - if (is_string($handler)) { |
|
75 | + if (is_string($handler)){ |
|
76 | 76 | return new Autowire($handler); |
77 | 77 | } |
78 | 78 | |
79 | - if (isset($handler['class'])) { |
|
79 | + if (isset($handler['class'])){ |
|
80 | 80 | return new Autowire($handler['class'], $handler['options'] ?? []); |
81 | 81 | } |
82 | 82 |
@@ -53,7 +53,7 @@ |
||
53 | 53 | { |
54 | 54 | $container = new Container(); |
55 | 55 | $container->bind(ConfiguratorInterface::class, new ConfigManager( |
56 | - new class() implements LoaderInterface { |
|
56 | + new class() implements LoaderInterface{ |
|
57 | 57 | public function has(string $section): bool |
58 | 58 | { |
59 | 59 | return false; |
@@ -43,7 +43,7 @@ |
||
43 | 43 | |
44 | 44 | $container = new Container(); |
45 | 45 | $container->bind(ConfiguratorInterface::class, new ConfigManager( |
46 | - new class() implements LoaderInterface { |
|
46 | + new class() implements LoaderInterface{ |
|
47 | 47 | public function has(string $section): bool |
48 | 48 | { |
49 | 49 | return false; |
@@ -35,7 +35,7 @@ |
||
35 | 35 | { |
36 | 36 | $this->container = new Container(); |
37 | 37 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
38 | - new class() implements LoaderInterface { |
|
38 | + new class() implements LoaderInterface{ |
|
39 | 39 | public function has(string $section): bool |
40 | 40 | { |
41 | 41 | return false; |
@@ -27,7 +27,7 @@ |
||
27 | 27 | { |
28 | 28 | $container = new Container(); |
29 | 29 | $container->bind(ConfiguratorInterface::class, new ConfigManager( |
30 | - new class() implements LoaderInterface { |
|
30 | + new class() implements LoaderInterface{ |
|
31 | 31 | public function has(string $section): bool |
32 | 32 | { |
33 | 33 | return false; |