Conditions | 6 |
Paths | 7 |
Total Lines | 19 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | 1 | public function export() |
|
29 | { |
||
30 | 1 | foreach ($this->messages as $message) { |
|
31 | 1 | [$context, , $category , , $traces] = $message; |
|
32 | |||
33 | 1 | if ($context instanceof Throwable) { |
|
34 | 1 | $this->component?->notify($context); |
|
35 | 1 | } elseif (is_string($context)) { |
|
36 | 1 | $data = [ |
|
37 | 1 | 'title' => $category, |
|
38 | 1 | 'message' => $context, |
|
39 | 1 | ]; |
|
40 | 1 | if (isset($traces[0]['file'])) { |
|
41 | 1 | $data['file'] = $traces[0]['file']; |
|
42 | } |
||
43 | 1 | if (isset($traces[0]['line'])) { |
|
44 | 1 | $data['line'] = $traces[0]['line']; |
|
45 | } |
||
46 | 1 | $this->component?->customNotification($data); |
|
47 | } |
||
63 |