PluginProbe
User Access Manager / 2.3.16
User Access Manager v2.3.16
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
← All changes | src/Cache/Cache.php +11 -4 trunk2.3.16 View file →
@@ -28,11 +28,13 @@
28 28 $this->cacheProvider = $this->getRegisteredCacheProviders()[$key] ?? null;
29 29 $this->cacheProvider?->init();
30 30 }
31 31
32 - public function generateCacheKey(...$keyParts): string
32 + public function generateCacheKey(): string
33 33 {
34 - return implode('|', $keyParts);
34 + $arguments = func_get_args();
35 +
36 + return implode('|', $arguments);
35 37 }
36 38
37 39 public function add(string $key, mixed $value): void
38 40 {
@@ -42,9 +44,9 @@
42 44
43 45 public function get(string $key): mixed
44 46 {
45 47 if (isset($this->cache[$key]) === false) {
46 - $this->cache[$key] = $this->cacheProvider?->get($key);
48 + $this->cache[$key] = ($this->cacheProvider !== null) ? $this->cacheProvider->get($key) : null;
47 49 }
48 50
49 51 return $this->cache[$key];
50 52 }
@@ -61,10 +63,15 @@
61 63 }
62 64
63 65 public function getFromRuntimeCache(string $key): mixed
64 66 {
65 - return $this->runtimeCache[$key] ?? null;
67 + if (isset($this->runtimeCache[$key]) === true) {
68 + return $this->runtimeCache[$key];
69 + }
70 +
71 + return null;
66 72 }
73 +
67 74
68 75 public function flushCache(): void
69 76 {
70 77 $this->cache = [];