@@ -21,7 +21,8 @@ discard block |
||
21 | 21 | $this->lolifier = $lolifier; |
22 | 22 | $this->bubble = $bubble; |
23 | 23 | |
24 | - if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { |
|
24 | + if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) |
|
25 | + { |
|
25 | 26 | throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); |
26 | 27 | } |
27 | 28 | } |
@@ -33,17 +34,21 @@ discard block |
||
33 | 34 | |
34 | 35 | public function handle(array $record) |
35 | 36 | { |
36 | - if (! $this->handler instanceof HandlerInterface) { |
|
37 | + if (! $this->handler instanceof HandlerInterface) |
|
38 | + { |
|
37 | 39 | $this->handler = call_user_func($this->handler, $record, $this); |
38 | - if (! $this->handler instanceof HandlerInterface) { |
|
40 | + if (! $this->handler instanceof HandlerInterface) |
|
41 | + { |
|
39 | 42 | throw new \RuntimeException("The factory callable should return a HandlerInterface"); |
40 | 43 | } |
41 | 44 | } |
42 | 45 | |
43 | 46 | $record = $this->lolifier->lolify($record); |
44 | 47 | |
45 | - if ($this->processors) { |
|
46 | - foreach ($this->processors as $processor) { |
|
48 | + if ($this->processors) |
|
49 | + { |
|
50 | + foreach ($this->processors as $processor) |
|
51 | + { |
|
47 | 52 | $record = call_user_func($processor, $record); |
48 | 53 | } |
49 | 54 | } |