| Total Complexity | 9 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | final class IdentityCollector implements SummaryCollectorInterface |
||
| 12 | { |
||
| 13 | use CollectorTrait; |
||
| 14 | |||
| 15 | private array $identities = []; |
||
| 16 | |||
| 17 | 3 | public function getCollected(): array |
|
| 23 | } |
||
| 24 | |||
| 25 | 2 | public function collect(?IdentityInterface $identity): void |
|
| 26 | { |
||
| 27 | 2 | if (!$this->isActive()) { |
|
| 28 | 1 | return; |
|
| 29 | } |
||
| 30 | |||
| 31 | 1 | if ($identity === null) { |
|
| 32 | 1 | return; |
|
| 33 | } |
||
| 34 | |||
| 35 | 1 | $this->identities[] = [ |
|
| 36 | 1 | 'id' => $identity->getId(), |
|
| 37 | 1 | 'class' => $identity::class, |
|
| 38 | 1 | ]; |
|
| 39 | } |
||
| 40 | |||
| 41 | 1 | private function reset(): void |
|
|
|
|||
| 42 | { |
||
| 43 | 1 | $this->identities = []; |
|
| 44 | } |
||
| 45 | |||
| 46 | 3 | public function getSummary(): array |
|
| 56 | 1 | ], |
|
| 57 | 1 | ]; |
|
| 58 | } |
||
| 60 |
This check looks for private methods that have been defined, but are not used inside the class.