| Total Complexity | 7 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 94.74% |
| 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 | 1 | public function getCollected(): array |
|
| 20 | } |
||
| 21 | |||
| 22 | 1 | public function collect(?IdentityInterface $identity): void |
|
| 23 | { |
||
| 24 | 1 | if (!$this->isActive()) { |
|
| 25 | return; |
||
| 26 | } |
||
| 27 | |||
| 28 | 1 | if ($identity === null) { |
|
| 29 | 1 | return; |
|
| 30 | } |
||
| 31 | |||
| 32 | 1 | $this->identities[] = [ |
|
| 33 | 1 | 'id' => $identity->getId(), |
|
| 34 | 1 | 'class' => $identity::class, |
|
| 35 | 1 | ]; |
|
| 36 | } |
||
| 37 | |||
| 38 | 1 | private function reset(): void |
|
|
|
|||
| 39 | { |
||
| 40 | 1 | $this->identities = []; |
|
| 41 | } |
||
| 42 | |||
| 43 | 1 | public function getSummary(): array |
|
| 50 | 1 | ], |
|
| 51 | 1 | ]; |
|
| 52 | } |
||
| 54 |
This check looks for private methods that have been defined, but are not used inside the class.