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

daycry / doctrine / 25509251920

07 May 2026 04:40PM UTC coverage: 92.41% (+3.5%) from 88.939%
25509251920

Pull #15

github

web-flow
Merge 2270784ae into 4b36cebe6
Pull Request #15: Audit follow-up: bug fixes, refactors, tests and full docs revamp

108 of 116 new or added lines in 10 files covered. (93.1%)

3 existing lines in 1 file now uncovered.

694 of 751 relevant lines covered (92.41%)

16.15 hits per line

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

83.33
/src/Debug/Filters/DoctrineSlcReset.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Daycry\Doctrine\Debug\Filters;
6

7
use CodeIgniter\Filters\FilterInterface;
8
use CodeIgniter\HTTP\RequestInterface;
9
use CodeIgniter\HTTP\ResponseInterface;
10
use Daycry\Doctrine\Config\Services;
11
use Throwable;
12

13
/**
14
 * Resets Second-Level Cache statistics counters at the start of every request,
15
 * so the Debug Toolbar shows hits/misses/puts scoped to the current request.
16
 *
17
 * Register in `app/Config/Filters.php`:
18
 *
19
 *     public array $globals = [
20
 *         'before' => [
21
 *             \Daycry\Doctrine\Debug\Filters\DoctrineSlcReset::class,
22
 *         ],
23
 *     ];
24
 *
25
 * Has no effect when `Config\Doctrine::$secondLevelCacheStatistics` is disabled
26
 * or the Doctrine service has not yet been instantiated.
27
 */
28
class DoctrineSlcReset implements FilterInterface
29
{
30
    public function before(RequestInterface $request, $arguments = null): RequestInterface|ResponseInterface|string|null
2✔
31
    {
32
        try {
33
            Services::doctrine()->resetSecondLevelCacheStatistics();
2✔
NEW
34
        } catch (Throwable) {
×
35
            // Toolbar filter must never break the request pipeline.
36
        }
37

38
        return null;
2✔
39
    }
40

41
    public function after(RequestInterface $request, ResponseInterface $response, $arguments = null): ?ResponseInterface
1✔
42
    {
43
        return null;
1✔
44
    }
45
}
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