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

h4kuna / critical-cache / 10593293712

28 Aug 2024 08:41AM UTC coverage: 93.365%. First build
10593293712

push

github

h4kuna
feat(Improve): easier API

122 of 133 new or added lines in 11 files covered. (91.73%)

197 of 211 relevant lines covered (93.36%)

0.93 hits per line

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

50.0
/src/Exceptions/MissingDependencyException.php
1
<?php declare(strict_types=1);
2

3
namespace h4kuna\CriticalCache\Exceptions;
4

5
use Beste\Clock\SystemClock;
6
use h4kuna\Dir\Dir;
7
use malkusch\lock\mutex\Mutex;
8
use Nette\Caching\Storages\FileStorage;
9
use RuntimeException;
10

11
final class MissingDependencyException extends RuntimeException
12
{
13

14
        public static function checkNetteCaching(): void
15
        {
16
                if (class_exists(FileStorage::class) === false) {
1✔
17
                        throw self::create(FileStorage::class, 'nette/caching');
×
18
                }
19
        }
1✔
20

21
        private static function create(string $class, string $package): self
22
        {
NEW
23
                return new self("Missing class \"$class\", you can install by: composer require $package");
×
24
        }
25

26
        public static function checkH4kunaDir(): void
27
        {
28
                if (class_exists(Dir::class) === false) {
1✔
29
                        throw self::create(Dir::class, 'h4kuna/dir');
×
30
                }
31
        }
1✔
32

33
        public static function checkBesteClock(): void
34
        {
NEW
35
                if (class_exists(SystemClock::class) === false) {
×
NEW
36
                        throw self::create(SystemClock::class, 'beste/clock');
×
37
                }
38
        }
39

40
        public static function checkMalkuschLock(): void
41
        {
42
                if (class_exists(Mutex::class) === false) {
1✔
NEW
43
                        throw self::create(Mutex::class, 'malkusch/lock');
×
44
                }
45
        }
1✔
46

47
}
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