Total Complexity | 7 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class LogCollection |
||
12 | { |
||
13 | private ManagerInterface $logger; |
||
14 | |||
15 | private MessageBuilderInterface $builder; |
||
16 | /** @var string[] */ |
||
17 | private array $data = []; |
||
18 | |||
19 | 3 | public function __construct(ManagerInterface $logger, string $entityName) |
|
20 | { |
||
21 | 3 | $this->logger = $logger; |
|
22 | 3 | $this->builder = $logger->createMessageBuilder($entityName); |
|
23 | } |
||
24 | |||
25 | /** |
||
26 | * @param string|int $value |
||
27 | */ |
||
28 | 1 | public function setEntityId($value): self |
|
29 | { |
||
30 | 1 | $this->builder = $this->builder->withEntityId($value); |
|
31 | 1 | return $this; |
|
32 | } |
||
33 | |||
34 | 1 | public function setAction(string $value): self |
|
38 | } |
||
39 | |||
40 | 3 | public function addMessage(string $value): void |
|
41 | { |
||
42 | 3 | $this->data[] = $value; |
|
43 | } |
||
44 | |||
45 | /** |
||
46 | * @return string[] |
||
47 | */ |
||
48 | 3 | private function flushData(): array |
|
53 | } |
||
54 | |||
55 | 3 | public function push(): bool |
|
67 | } |
||
68 | } |