@@ -55,7 +55,8 @@ |
||
55 | 55 | $context |
56 | 56 | ); |
57 | 57 | |
58 | - foreach ($this->listenedRegistry->getListeners() as $listener) { |
|
58 | + foreach ($this->listenedRegistry->getListeners() as $listener) |
|
59 | + { |
|
59 | 60 | call_user_func($listener, $e); |
60 | 61 | } |
61 | 62 | } |
@@ -24,7 +24,8 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function addListener(callable $listener): void |
26 | 26 | { |
27 | - if (!array_search($listener, $this->listeners, true)) { |
|
27 | + if (!array_search($listener, $this->listeners, true)) |
|
28 | + { |
|
28 | 29 | $this->listeners[] = $listener; |
29 | 30 | } |
30 | 31 | } |
@@ -35,7 +36,8 @@ discard block |
||
35 | 36 | public function removeListener(callable $listener): void |
36 | 37 | { |
37 | 38 | $key = array_search($listener, $this->listeners, true); |
38 | - if ($key !== null) { |
|
39 | + if ($key !== null) |
|
40 | + { |
|
39 | 41 | unset($this->listeners[$key]); |
40 | 42 | } |
41 | 43 | } |
@@ -42,11 +42,13 @@ discard block |
||
42 | 42 | */ |
43 | 43 | protected function getLogger(string $channel = null): LoggerInterface |
44 | 44 | { |
45 | - if ($channel !== null) { |
|
45 | + if ($channel !== null) |
|
46 | + { |
|
46 | 47 | return $this->allocateLogger($channel); |
47 | 48 | } |
48 | 49 | |
49 | - if ($this->logger !== null) { |
|
50 | + if ($this->logger !== null) |
|
51 | + { |
|
50 | 52 | return $this->logger; |
51 | 53 | } |
52 | 54 | |
@@ -63,7 +65,8 @@ discard block |
||
63 | 65 | private function allocateLogger(string $channel): LoggerInterface |
64 | 66 | { |
65 | 67 | $container = ContainerScope::getContainer(); |
66 | - if (empty($container) || !$container->has(LogsInterface::class)) { |
|
68 | + if (empty($container) || !$container->has(LogsInterface::class)) |
|
69 | + { |
|
67 | 70 | return $this->logger ?? new NullLogger(); |
68 | 71 | } |
69 | 72 |