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

daycry / doctrine / 25507303940

07 May 2026 04:02PM UTC coverage: 86.818% (-2.1%) from 88.939%
25507303940

Pull #15

github

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

96 of 116 new or added lines in 10 files covered. (82.76%)

3 existing lines in 1 file now uncovered.

652 of 751 relevant lines covered (86.82%)

15.46 hits per line

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

27.27
/src/Libraries/InitializesNativeClient.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Daycry\Doctrine\Libraries;
6

7
use CodeIgniter\Cache\Exceptions\CacheException;
8
use Throwable;
9

10
/**
11
 * Initializes a CodeIgniter cache handler and converts low-level connection
12
 * failures into CacheException, preserving the original exception as `previous`.
13
 *
14
 * Used by Daycry\Doctrine\Libraries\Memcached and Daycry\Doctrine\Libraries\Redis.
15
 */
16
trait InitializesNativeClient
17
{
18
    /**
19
     * @param non-empty-string $extension Extension name required for this client (e.g. 'memcached', 'redis').
20
     * @param non-empty-string $driver    Human-readable driver name used in error messages.
21
     */
22
    protected function bootClient(string $extension, string $driver): void
6✔
23
    {
24
        if (! extension_loaded($extension)) {
6✔
NEW
25
            throw new CacheException(sprintf(
×
NEW
26
                '%s extension not loaded; install php-%s to enable %s cache backend.',
×
NEW
27
                ucfirst($extension),
×
NEW
28
                $extension,
×
NEW
29
                $driver,
×
NEW
30
            ));
×
31
        }
32

33
        try {
34
            $this->initialize();
6✔
NEW
35
        } catch (Throwable $e) {
×
NEW
36
            throw new CacheException(sprintf('Failed to connect to %s: %s', $driver, $e->getMessage()), 0, $e);
×
37
        }
38
    }
39
}
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