| Total Complexity | 8 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Coverage | 94.74% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | final class EventCollector implements EventCollectorInterface, IndexCollectorInterface |
||
| 14 | { |
||
| 15 | use CollectorTrait; |
||
| 16 | |||
| 17 | private array $events = []; |
||
| 18 | |||
| 19 | 1 | public function getCollected(): array |
|
| 20 | { |
||
| 21 | 1 | return $this->events; |
|
| 22 | } |
||
| 23 | |||
| 24 | 1 | public function collect(object $event): void |
|
| 25 | { |
||
| 26 | if ( |
||
| 27 | 1 | !$event instanceof HttpApplicationStartup |
|
| 28 | 1 | && !$event instanceof ConsoleApplicationStartup |
|
| 29 | 1 | && !$this->isActive() |
|
| 30 | ) { |
||
| 31 | return; |
||
| 32 | } |
||
| 33 | |||
| 34 | 1 | $this->collectEvent($event); |
|
| 35 | 1 | } |
|
| 36 | |||
| 37 | 1 | private function collectEvent(object $event): void |
|
| 43 | ]; |
||
| 44 | 1 | } |
|
| 45 | |||
| 46 | 1 | #[ArrayShape(['totalEvents' => 'int'])] |
|
| 47 | public function getIndexData(): array |
||
| 48 | { |
||
| 49 | return [ |
||
| 50 | 1 | 'totalEvents' => count($this->events), |
|
| 51 | ]; |
||
| 52 | } |
||
| 53 | |||
| 54 | 1 | private function reset(): void |
|
| 57 | 1 | } |
|
| 58 | } |
||
| 59 |
This check looks for private methods that have been defined, but are not used inside the class.