aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/cache/DbCache.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/classes/cache/DbCache.class.php')
-rw-r--r--lib/classes/cache/DbCache.class.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/classes/cache/DbCache.class.php b/lib/classes/cache/DbCache.class.php
index 3361af0..c7abef2 100644
--- a/lib/classes/cache/DbCache.class.php
+++ b/lib/classes/cache/DbCache.class.php
@@ -3,6 +3,7 @@
namespace Studip\Cache;
use DBManager;
+use Psr\Cache\CacheItemInterface;
/**
* StudipCache implementation using database table
@@ -88,7 +89,7 @@ class DbCache extends Cache
/**
* @inheritDoc
*/
- public function getItem($key)
+ public function getItem(string $key): CacheItemInterface
{
$query = "SELECT `content`, `expires`
FROM `cache`
@@ -114,7 +115,7 @@ class DbCache extends Cache
/**
* @inheritDoc
*/
- public function hasItem($key)
+ public function hasItem(string $key): bool
{
$query = "SELECT 1
FROM `cache`
@@ -126,7 +127,7 @@ class DbCache extends Cache
/**
* @inheritDoc
*/
- public function save(\Psr\Cache\CacheItemInterface $item)
+ public function save(CacheItemInterface $item): bool
{
$expiration = $this->getExpiration($item);
if ($expiration < 1) {