| Total Complexity | 8 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 94.12% |
| 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 |
|
| 22 | } |
||
| 23 | |||
| 24 | 1 | public function collect(object $event, string $line): void |
|
| 25 | { |
||
| 26 | if ( |
||
| 27 | 1 | !$event instanceof HttpApplicationStartup |
|
| 28 | && !$event instanceof ConsoleApplicationStartup |
||
| 29 | 1 | && !$this->isActive() |
|
| 30 | ) { |
||
| 31 | return; |
||
| 32 | } |
||
| 33 | |||
| 34 | 1 | $this->collectEvent($event, $line); |
|
| 35 | } |
||
| 36 | |||
| 37 | 1 | private function collectEvent(object $event, $line): void |
|
| 44 | ]; |
||
| 45 | } |
||
| 46 | |||
| 47 | 1 | #[ArrayShape(['totalEvents' => 'int'])] |
|
| 48 | public function getIndexData(): array |
||
| 49 | { |
||
| 50 | return [ |
||
| 51 | 1 | 'totalEvents' => count($this->events), |
|
| 52 | ]; |
||
| 53 | } |
||
| 54 | |||
| 55 | 1 | private function reset(): void |
|
| 58 | } |
||
| 59 | } |
||
| 60 |
This check looks for private methods that have been defined, but are not used inside the class.