| Total Complexity | 6 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | class ErrorListener implements ListenerInterface |
||
| 30 | { |
||
| 31 | /** @var array<LogEvent> */ |
||
| 32 | private $errors = []; |
||
| 33 | |||
| 34 | public function __invoke(LogEvent $event): void |
||
| 35 | { |
||
| 36 | switch ($event->getSeverity()) { |
||
| 37 | case LogLevel::EMERGENCY: |
||
| 38 | case LogLevel::ALERT: |
||
| 39 | case LogLevel::CRITICAL: |
||
| 40 | case LogLevel::ERROR: |
||
| 41 | $this->errors[] = $event; |
||
| 42 | break; |
||
| 43 | default: |
||
| 44 | // do not collect |
||
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return array<LogEvent> |
||
| 50 | */ |
||
| 51 | public function getErrors(): array |
||
| 54 | } |
||
| 55 | } |
||
| 56 |