Total Complexity | 7 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 94.74% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | final class IdentityCollector implements CollectorInterface, IndexCollectorInterface |
||
13 | { |
||
14 | use CollectorTrait; |
||
15 | |||
16 | private array $identities = []; |
||
17 | |||
18 | 1 | public function getCollected(): array |
|
21 | } |
||
22 | |||
23 | 1 | public function collect(?IdentityInterface $identity): void |
|
24 | { |
||
25 | 1 | if (!$this->isActive()) { |
|
26 | return; |
||
27 | } |
||
28 | |||
29 | 1 | if ($identity === null) { |
|
30 | 1 | return; |
|
31 | } |
||
32 | |||
33 | 1 | $this->identities[] = [ |
|
34 | 1 | 'id' => $identity->getId(), |
|
35 | 1 | 'class' => $identity::class, |
|
36 | 1 | ]; |
|
37 | } |
||
38 | |||
39 | 1 | private function reset(): void |
|
|
|||
40 | { |
||
41 | 1 | $this->identities = []; |
|
42 | } |
||
43 | |||
44 | 1 | public function getIndexData(): array |
|
51 | 1 | ], |
|
52 | 1 | ]; |
|
53 | } |
||
55 |
This check looks for private methods that have been defined, but are not used inside the class.