• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

letsdrink / ouzo / 24999313747

27 Apr 2026 01:56PM UTC coverage: 84.665% (-1.2%) from 85.822%
24999313747

Pull #334

github

bbankowski
Fix code coverage generation in CI

- Install pcov driver for PostgreSQL job (coverage runs once, not 3x)
- Add --coverage-clover flag to PHPUnit when coverage is enabled
- Skip coverage driver installation for MySQL/SQLite jobs (faster)
- Remove redundant 'test' argument (phpunit.xml has testsuites)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pull Request #334: Migrate to PHP 8.4 (Ouzo 4.0.0)

34 of 43 new or added lines in 10 files covered. (79.07%)

77 existing lines in 11 files now uncovered.

4947 of 5843 relevant lines covered (84.67%)

34.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

29.41
/src/Ouzo/Core/ExceptionHandling/ErrorHandler.php
1
<?php
2
/*
3
 * Copyright (c) Ouzo contributors, https://github.com/letsdrink/ouzo
4
 * This file is made available under the MIT License (view the LICENSE file for more information).
5
 */
6

7
namespace Ouzo\ExceptionHandling;
8

9
use ErrorException;
10
use Throwable;
11

12
class ErrorHandler
13
{
14
    public function __construct(private readonly ExceptionHandler $exceptionHandler)
15
    {
16
    }
4✔
17

18
    public function register(): void
19
    {
20
        set_exception_handler(fn(Throwable $exception) => $this->handleException($exception));
3✔
21
        set_error_handler(fn(...$args) => $this->handleError(...$args), E_ALL & ~E_DEPRECATED);
3✔
22
        register_shutdown_function(fn() => $this->handleShutdown());
3✔
23
    }
24

25
    public function handleException(Throwable $exception): void
26
    {
27
        $this->exceptionHandler->handleException($exception);
1✔
28
    }
29

30
    public function handleError(int $errorNumber, string $errorString, string $errorFile, int $errorLine): void
31
    {
UNCOV
32
        if ($this->stopsExecution($errorNumber)) {
×
33
            $this->handleException(new ErrorException($errorString, $errorNumber, $errorNumber, $errorFile, $errorLine));
×
34
        } else {
UNCOV
35
            throw new ErrorException($errorString, $errorNumber, $errorNumber, $errorFile, $errorLine);
×
36
        }
37
    }
38

39
    public function stopsExecution($errno): bool
40
    {
UNCOV
41
        return match ($errno) {
×
UNCOV
42
            E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR => true,
×
UNCOV
43
            default => false
×
UNCOV
44
        };
×
45
    }
46

47
    public function handleShutdown(): void
48
    {
49
        $error = error_get_last();
×
50

51
        if (!$this->exceptionHandler->lastErrorHandled() && $error && $error['type'] & (E_ERROR | E_USER_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_RECOVERABLE_ERROR)) {
×
52
            $stackTrace = new StackTrace($error['file'], $error['line']);
×
53
            $exceptionData = new OuzoExceptionData(500, [new Error(0, $error['message'])], $stackTrace, [], null, $error['type']);
×
54
            $this->exceptionHandler->handleExceptionData($exceptionData);
×
55
        }
56
    }
57
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc