Total Complexity | 5 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 90.91% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | final class LogCollector implements LogCollectorInterface, IndexCollectorInterface |
||
10 | { |
||
11 | use CollectorTrait; |
||
12 | |||
13 | private array $messages = []; |
||
14 | |||
15 | 2 | public function getCollected(): array |
|
18 | } |
||
19 | |||
20 | 2 | public function collect(string $level, $message, array $context, string $line): void |
|
21 | { |
||
22 | 2 | if (!$this->isActive()) { |
|
23 | return; |
||
24 | } |
||
25 | |||
26 | 2 | $this->messages[] = [ |
|
27 | 2 | 'time' => microtime(true), |
|
28 | 'level' => $level, |
||
29 | 'message' => $message, |
||
30 | 'context' => $context, |
||
31 | 'line' => $line, |
||
32 | ]; |
||
33 | } |
||
34 | |||
35 | 1 | private function reset(): void |
|
|
|||
36 | { |
||
37 | 1 | $this->messages = []; |
|
38 | } |
||
39 | |||
40 | 1 | #[ArrayShape(['totalLogs' => 'int'])] |
|
45 | ]; |
||
46 | } |
||
47 | } |
||
48 |
This check looks for private methods that have been defined, but are not used inside the class.