aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/cache/Proxy.class.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2024-05-15 19:10:49 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2024-05-15 19:10:49 +0000
commit7fbf01fafcbc022831e9717a892a084b3c6e6e59 (patch)
tree7520a5af1ba8bffc5664544fd3c76cdff4c33de4 /lib/classes/cache/Proxy.class.php
parenteb4f3bba75580ee1bd04e2b6677028ff28e6a1af (diff)
update psr/cache to 3.0.0 and adjust everything necessary, fixes #4152
Closes #4152 Merge request studip/studip!2992
Diffstat (limited to 'lib/classes/cache/Proxy.class.php')
-rw-r--r--lib/classes/cache/Proxy.class.php21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/classes/cache/Proxy.class.php b/lib/classes/cache/Proxy.class.php
index 6791fb7..fef034d 100644
--- a/lib/classes/cache/Proxy.class.php
+++ b/lib/classes/cache/Proxy.class.php
@@ -2,6 +2,7 @@
namespace Studip\Cache;
+use Psr\Cache\CacheItemInterface;
use StudipCacheOperation;
/**
@@ -39,20 +40,20 @@ class Proxy extends Cache
/**
* Expires just a single key.
*
- * @param string $key The item's key
+ * @param string $arg The item's key
*/
- public function expire($key)
+ public function expire($arg)
{
if (in_array('expire', $this->proxy_these)) {
try {
- $operation = new StudipCacheOperation([$key, 'expire']);
+ $operation = new StudipCacheOperation([$arg, 'expire']);
$operation->parameters = serialize([]);
$operation->store();
- } catch (\Exception $e) {
+ } catch (\Exception) {
}
}
- return $this->actual_cache->expire($key);
+ return $this->actual_cache->expire($arg);
}
/**
@@ -65,7 +66,7 @@ class Proxy extends Cache
$operation = new StudipCacheOperation(['', 'flush']);
$operation->parameters = serialize([]);
$operation->store();
- } catch (\Exception $e) {
+ } catch (\Exception) {
}
}
@@ -90,7 +91,7 @@ class Proxy extends Cache
/**
* @inheritDoc
*/
- public function getItem($key)
+ public function getItem(string $key): CacheItemInterface
{
return $this->actual_cache->getItem($key);
}
@@ -98,7 +99,7 @@ class Proxy extends Cache
/**
* @inheritDoc
*/
- public function hasItem($key)
+ public function hasItem(string $key): bool
{
return $this->actual_cache->hasItem($key);
}
@@ -106,14 +107,14 @@ class Proxy extends Cache
/**
* @inheritDoc
*/
- public function save(\Psr\Cache\CacheItemInterface $item)
+ public function save(CacheItemInterface $item): bool
{
if (in_array('save', $this->proxy_these)) {
try {
$operation = new StudipCacheOperation([$item->getKey(), 'save']);
$operation->parameters = serialize([$item]);
$operation->store();
- } catch (\Exception $e) {
+ } catch (\Exception) {
}
}