-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCacheManagerImplDryMode.php
More file actions
62 lines (52 loc) · 1.19 KB
/
CacheManagerImplDryMode.php
File metadata and controls
62 lines (52 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
namespace CacheMultiLayer\Service;
use CacheMultiLayer\Interface\Cacheable;
use Override;
/**
*
* cache manager in dry run mode, where the entire cache system is bypassed
* @author Damiano Improta <code@damianoimprota.dev>
*/
class CacheManagerImplDryMode extends CacheManagerImpl
{
#[\Override]
public function appendCache(Cache $cache): bool
{
return parent::appendCache($cache);
}
#[Override]
public function clear(string $key): bool
{
return true;
}
#[Override]
public function clearAllCache(): bool
{
return true;
}
#[Override]
public function decrement(string $key, ?int $ttl = null): array
{
return [];
}
#[Override]
public function get(string $key): int|float|string|Cacheable|array|null
{
return null;
}
#[Override]
public function getRemainingTTL(string $key): array
{
return [];
}
#[Override]
public function increment(string $key, ?int $ttl = null): array
{
return [];
}
#[Override]
public function set(string $key, int|float|string|Cacheable|array $val, ?int $ttl = null): bool
{
return true;
}
}