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