Total Complexity | 3 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | final class LogCollector implements StateCollectorInterface |
||
19 | { |
||
20 | /** @var LogEvent[] */ |
||
21 | private $logEvents = []; |
||
22 | |||
23 | /** |
||
24 | * @param LogEvent $event |
||
25 | */ |
||
26 | public function __invoke(LogEvent $event): void |
||
27 | { |
||
28 | $this->logEvents[] = $event; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @param StateInterface $state |
||
33 | */ |
||
34 | public function populate(StateInterface $state): void |
||
35 | { |
||
36 | $state->addLogEvent(...$this->logEvents); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Reset the collector state. |
||
41 | */ |
||
42 | public function reset(): void |
||
45 | } |
||
46 | } |
||
47 |