PluginProbe
User Access Manager / trunk
User Access Manager vtrunk
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 +4 -11 2.3.14trunk View file →
@@ -28,13 +28,11 @@
28 28 $this->cacheProvider = $this->getRegisteredCacheProviders()[$key] ?? null;
29 29 $this->cacheProvider?->init();
30 30 }
31 31
32 - public function generateCacheKey(): string
32 + public function generateCacheKey(...$keyParts): string
33 33 {
34 - $arguments = func_get_args();
35 -
36 - return implode('|', $arguments);
34 + return implode('|', $keyParts);
37 35 }
38 36
39 37 public function add(string $key, mixed $value): void
40 38 {
@@ -44,9 +42,9 @@
44 42
45 43 public function get(string $key): mixed
46 44 {
47 45 if (isset($this->cache[$key]) === false) {
48 - $this->cache[$key] = ($this->cacheProvider !== null) ? $this->cacheProvider->get($key) : null;
46 + $this->cache[$key] = $this->cacheProvider?->get($key);
49 47 }
50 48
51 49 return $this->cache[$key];
52 50 }
@@ -63,15 +61,10 @@
63 61 }
64 62
65 63 public function getFromRuntimeCache(string $key): mixed
66 64 {
67 - if (isset($this->runtimeCache[$key]) === true) {
68 - return $this->runtimeCache[$key];
69 - }
70 -
71 - return null;
65 + return $this->runtimeCache[$key] ?? null;
72 66 }
73 -
74 67
75 68 public function flushCache(): void
76 69 {
77 70 $this->cache = [];