Skip to content
Snippets Groups Projects
Commit 7fbf01fa authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

update psr/cache to 3.0.0 and adjust everything necessary, fixes #4152

Closes #4152

Merge request studip/studip!2992
parent eb4f3bba
No related branches found
No related tags found
No related merge requests found
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
"okvpn/clock-lts": "^1.0", "okvpn/clock-lts": "^1.0",
"vlucas/phpdotenv": "^5.6", "vlucas/phpdotenv": "^5.6",
"edu-sharing/auth-plugin": "8.0.x-dev", "edu-sharing/auth-plugin": "8.0.x-dev",
"psr/cache": "^1.0" "psr/cache": "3.0.0"
}, },
"replace": { "replace": {
"symfony/polyfill-php73": "*", "symfony/polyfill-php73": "*",
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "f50f62060597f2d86eb61fc8af9cf333", "content-hash": "4f5e2e10224f8606704af0c8e80acc02",
"packages": [ "packages": [
{ {
"name": "algo26-matthias/idna-convert", "name": "algo26-matthias/idna-convert",
...@@ -740,56 +740,6 @@ ...@@ -740,56 +740,6 @@
}, },
"time": "2022-11-12T10:09:40+00:00" "time": "2022-11-12T10:09:40+00:00"
}, },
{
"name": "kub-at/php-simple-html-dom-parser",
"version": "1.9.1",
"source": {
"type": "git",
"url": "https://github.com/Kub-AT/php-simple-html-dom-parser.git",
"reference": "ff22f98bfd9235115c128059076f3eb740d66913"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Kub-AT/php-simple-html-dom-parser/zipball/ff22f98bfd9235115c128059076f3eb740d66913",
"reference": "ff22f98bfd9235115c128059076f3eb740d66913",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"autoload": {
"psr-0": {
"KubAT\\PhpSimple\\HtmlDomParser": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "S.C. Chen",
"email": "me578022@gmail.com"
},
{
"name": "Jakub Stawowy",
"email": "Kub-AT@users.noreply.github.com"
}
],
"description": "PHP Simple HTML DOM Parser with namespace and PHP 7.3 compatible",
"homepage": "http://simplehtmldom.sourceforge.net/",
"keywords": [
"Simple",
"dom",
"html"
],
"support": {
"issues": "https://github.com/Kub-AT/php-simple-html-dom-parser/issues",
"source": "https://github.com/Kub-AT/php-simple-html-dom-parser/tree/master"
},
"time": "2019-10-25T12:34:43+00:00"
},
{ {
"name": "laravel/serializable-closure", "name": "laravel/serializable-closure",
"version": "v1.3.3", "version": "v1.3.3",
...@@ -2733,20 +2683,20 @@ ...@@ -2733,20 +2683,20 @@
}, },
{ {
"name": "psr/cache", "name": "psr/cache",
"version": "1.0.1", "version": "3.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-fig/cache.git", "url": "https://github.com/php-fig/cache.git",
"reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
"reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.0" "php": ">=8.0.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
...@@ -2766,7 +2716,7 @@ ...@@ -2766,7 +2716,7 @@
"authors": [ "authors": [
{ {
"name": "PHP-FIG", "name": "PHP-FIG",
"homepage": "http://www.php-fig.org/" "homepage": "https://www.php-fig.org/"
} }
], ],
"description": "Common interface for caching libraries", "description": "Common interface for caching libraries",
...@@ -2776,9 +2726,9 @@ ...@@ -2776,9 +2726,9 @@
"psr-6" "psr-6"
], ],
"support": { "support": {
"source": "https://github.com/php-fig/cache/tree/master" "source": "https://github.com/php-fig/cache/tree/3.0.0"
}, },
"time": "2016-08-06T20:24:11+00:00" "time": "2021-02-03T23:26:27+00:00"
}, },
{ {
"name": "psr/clock", "name": "psr/clock",
...@@ -7252,58 +7202,57 @@ ...@@ -7252,58 +7202,57 @@
}, },
{ {
"name": "symfony/cache", "name": "symfony/cache",
"version": "v5.4.39", "version": "v6.4.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/cache.git", "url": "https://github.com/symfony/cache.git",
"reference": "982237e35079fdcc31ab724f06b6131992c4fd24" "reference": "b9e9b93c9817ec6c789c7943f5e54b57a041c16a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/cache/zipball/982237e35079fdcc31ab724f06b6131992c4fd24", "url": "https://api.github.com/repos/symfony/cache/zipball/b9e9b93c9817ec6c789c7943f5e54b57a041c16a",
"reference": "982237e35079fdcc31ab724f06b6131992c4fd24", "reference": "b9e9b93c9817ec6c789c7943f5e54b57a041c16a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.2.5", "php": ">=8.1",
"psr/cache": "^1.0|^2.0", "psr/cache": "^2.0|^3.0",
"psr/log": "^1.1|^2|^3", "psr/log": "^1.1|^2|^3",
"symfony/cache-contracts": "^1.1.7|^2", "symfony/cache-contracts": "^2.5|^3",
"symfony/deprecation-contracts": "^2.1|^3", "symfony/service-contracts": "^2.5|^3",
"symfony/polyfill-php73": "^1.9", "symfony/var-exporter": "^6.3.6|^7.0"
"symfony/polyfill-php80": "^1.16",
"symfony/service-contracts": "^1.1|^2|^3",
"symfony/var-exporter": "^4.4|^5.0|^6.0"
}, },
"conflict": { "conflict": {
"doctrine/dbal": "<2.13.1", "doctrine/dbal": "<2.13.1",
"symfony/dependency-injection": "<4.4", "symfony/dependency-injection": "<5.4",
"symfony/http-kernel": "<4.4", "symfony/http-kernel": "<5.4",
"symfony/var-dumper": "<4.4" "symfony/var-dumper": "<5.4"
}, },
"provide": { "provide": {
"psr/cache-implementation": "1.0|2.0", "psr/cache-implementation": "2.0|3.0",
"psr/simple-cache-implementation": "1.0|2.0", "psr/simple-cache-implementation": "1.0|2.0|3.0",
"symfony/cache-implementation": "1.0|2.0" "symfony/cache-implementation": "1.1|2.0|3.0"
}, },
"require-dev": { "require-dev": {
"cache/integration-tests": "dev-master", "cache/integration-tests": "dev-master",
"doctrine/cache": "^1.6|^2.0",
"doctrine/dbal": "^2.13.1|^3|^4", "doctrine/dbal": "^2.13.1|^3|^4",
"predis/predis": "^1.1", "predis/predis": "^1.1|^2.0",
"psr/simple-cache": "^1.0|^2.0", "psr/simple-cache": "^1.0|^2.0|^3.0",
"symfony/config": "^4.4|^5.0|^6.0", "symfony/config": "^5.4|^6.0|^7.0",
"symfony/dependency-injection": "^4.4|^5.0|^6.0", "symfony/dependency-injection": "^5.4|^6.0|^7.0",
"symfony/filesystem": "^4.4|^5.0|^6.0", "symfony/filesystem": "^5.4|^6.0|^7.0",
"symfony/http-kernel": "^4.4|^5.0|^6.0", "symfony/http-kernel": "^5.4|^6.0|^7.0",
"symfony/messenger": "^4.4|^5.0|^6.0", "symfony/messenger": "^5.4|^6.0|^7.0",
"symfony/var-dumper": "^4.4|^5.0|^6.0" "symfony/var-dumper": "^5.4|^6.0|^7.0"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Symfony\\Component\\Cache\\": "" "Symfony\\Component\\Cache\\": ""
}, },
"classmap": [
"Traits/ValueWrapper.php"
],
"exclude-from-classmap": [ "exclude-from-classmap": [
"/Tests/" "/Tests/"
] ]
...@@ -7329,7 +7278,7 @@ ...@@ -7329,7 +7278,7 @@
"psr6" "psr6"
], ],
"support": { "support": {
"source": "https://github.com/symfony/cache/tree/v5.4.39" "source": "https://github.com/symfony/cache/tree/v6.4.7"
}, },
"funding": [ "funding": [
{ {
...@@ -7345,7 +7294,7 @@ ...@@ -7345,7 +7294,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-04-18T08:26:06+00:00" "time": "2024-04-18T09:22:46+00:00"
}, },
{ {
"name": "symfony/cache-contracts", "name": "symfony/cache-contracts",
......
...@@ -72,12 +72,12 @@ abstract class Cache implements CacheItemPoolInterface ...@@ -72,12 +72,12 @@ abstract class Cache implements CacheItemPoolInterface
/** /**
* @see CacheItemPoolInterface::getItem * @see CacheItemPoolInterface::getItem
*/ */
abstract public function getItem($key); abstract public function getItem(string $key): CacheItemInterface;
/** /**
* @see CacheItemPoolInterface::hasItem * @see CacheItemPoolInterface::hasItem
*/ */
abstract public function hasItem($key); abstract public function hasItem(string $key): bool;
/** /**
* @var array An array of deferred items that shall be saved only * @var array An array of deferred items that shall be saved only
...@@ -149,7 +149,7 @@ abstract class Cache implements CacheItemPoolInterface ...@@ -149,7 +149,7 @@ abstract class Cache implements CacheItemPoolInterface
/** /**
* @see CacheItemPoolInterface::getItems * @see CacheItemPoolInterface::getItems
*/ */
public function getItems(array $keys = []) public function getItems(array $keys = []): iterable
{ {
$items = []; $items = [];
foreach ($keys as $key) { foreach ($keys as $key) {
...@@ -164,45 +164,50 @@ abstract class Cache implements CacheItemPoolInterface ...@@ -164,45 +164,50 @@ abstract class Cache implements CacheItemPoolInterface
/** /**
* @see CacheItemPoolInterface::clear * @see CacheItemPoolInterface::clear
*/ */
public function clear() public function clear(): bool
{ {
$this->deferred_items = []; $this->deferred_items = [];
$this->flush(); $this->flush();
return true;
} }
/** /**
* @see CacheItemPoolInterface::deleteItem * @see CacheItemPoolInterface::deleteItem
*/ */
public function deleteItem($key) public function deleteItem($key): bool
{ {
$this->expire($key); $this->expire($key);
return true;
} }
/** /**
* @see CacheItemPoolInterface::deleteItems * @see CacheItemPoolInterface::deleteItems
*/ */
public function deleteItems(array $keys) public function deleteItems(array $keys): bool
{ {
foreach ($keys as $key) { foreach ($keys as $key) {
$this->expire($key); $this->expire($key);
} }
return true;
} }
/** /**
* @see CacheItemPoolInterface::saveDeferred * @see CacheItemPoolInterface::saveDeferred
*/ */
public function saveDeferred(CacheItemInterface $item) public function saveDeferred(CacheItemInterface $item): bool
{ {
$this->deferred_items[] = $item; $this->deferred_items[] = $item;
return true;
} }
/** /**
* @see CacheItemPoolInterface::commit * @see CacheItemPoolInterface::commit
*/ */
public function commit() public function commit(): bool
{ {
foreach ($this->deferred_items as $item) { foreach ($this->deferred_items as $item) {
$this->save($item); $this->save($item);
} }
return true;
} }
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Studip\Cache; namespace Studip\Cache;
use DBManager; use DBManager;
use Psr\Cache\CacheItemInterface;
/** /**
* StudipCache implementation using database table * StudipCache implementation using database table
...@@ -88,7 +89,7 @@ class DbCache extends Cache ...@@ -88,7 +89,7 @@ class DbCache extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function getItem($key) public function getItem(string $key): CacheItemInterface
{ {
$query = "SELECT `content`, `expires` $query = "SELECT `content`, `expires`
FROM `cache` FROM `cache`
...@@ -114,7 +115,7 @@ class DbCache extends Cache ...@@ -114,7 +115,7 @@ class DbCache extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function hasItem($key) public function hasItem(string $key): bool
{ {
$query = "SELECT 1 $query = "SELECT 1
FROM `cache` FROM `cache`
...@@ -126,7 +127,7 @@ class DbCache extends Cache ...@@ -126,7 +127,7 @@ class DbCache extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function save(\Psr\Cache\CacheItemInterface $item) public function save(CacheItemInterface $item): bool
{ {
$expiration = $this->getExpiration($item); $expiration = $this->getExpiration($item);
if ($expiration < 1) { if ($expiration < 1) {
......
...@@ -4,6 +4,7 @@ namespace Studip\Cache; ...@@ -4,6 +4,7 @@ namespace Studip\Cache;
use Config; use Config;
use Exception; use Exception;
use Psr\Cache\CacheItemInterface;
/** /**
* Cache implementation using files * Cache implementation using files
...@@ -223,7 +224,7 @@ class FileCache extends Cache ...@@ -223,7 +224,7 @@ class FileCache extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function getItem($key) public function getItem(string $key): CacheItemInterface
{ {
$real_key = $this->getCacheKey($key); $real_key = $this->getCacheKey($key);
...@@ -251,7 +252,7 @@ class FileCache extends Cache ...@@ -251,7 +252,7 @@ class FileCache extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function hasItem($key) public function hasItem(string $key): bool
{ {
$real_key = $this->getCacheKey($key); $real_key = $this->getCacheKey($key);
$file_data = $this->check($real_key); $file_data = $this->check($real_key);
...@@ -261,7 +262,7 @@ class FileCache extends Cache ...@@ -261,7 +262,7 @@ class FileCache extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function save(\Psr\Cache\CacheItemInterface $item) public function save(CacheItemInterface $item): bool
{ {
$expiration = $this->getExpiration($item); $expiration = $this->getExpiration($item);
if ($expiration < 1) { if ($expiration < 1) {
......
...@@ -71,7 +71,7 @@ class Item implements CacheItemInterface ...@@ -71,7 +71,7 @@ class Item implements CacheItemInterface
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function getKey() public function getKey(): string
{ {
return $this->key; return $this->key;
} }
...@@ -79,7 +79,7 @@ class Item implements CacheItemInterface ...@@ -79,7 +79,7 @@ class Item implements CacheItemInterface
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function get() public function get(): mixed
{ {
return $this->value; return $this->value;
} }
...@@ -87,7 +87,7 @@ class Item implements CacheItemInterface ...@@ -87,7 +87,7 @@ class Item implements CacheItemInterface
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function isHit() public function isHit(): bool
{ {
return $this->cache_hit; return $this->cache_hit;
} }
...@@ -95,15 +95,16 @@ class Item implements CacheItemInterface ...@@ -95,15 +95,16 @@ class Item implements CacheItemInterface
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function set($value) public function set($value): static
{ {
$this->value = $value; $this->value = $value;
return $this;
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function expiresAt($expiration) public function expiresAt($expiration): static
{ {
$this->expiration = $expiration; $this->expiration = $expiration;
return $this; return $this;
...@@ -112,7 +113,7 @@ class Item implements CacheItemInterface ...@@ -112,7 +113,7 @@ class Item implements CacheItemInterface
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function expiresAfter($time) public function expiresAfter($time): static
{ {
$this->expiration = new DateTime(); $this->expiration = new DateTime();
if ($time instanceof DateInterval) { if ($time instanceof DateInterval) {
......
...@@ -114,7 +114,7 @@ class MemcachedCache extends Cache ...@@ -114,7 +114,7 @@ class MemcachedCache extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function getItem($key) public function getItem(string $key): CacheItemInterface
{ {
$item = new Item($key); $item = new Item($key);
$value = $this->memcache->get($this->getCacheKey($key)); $value = $this->memcache->get($this->getCacheKey($key));
...@@ -129,7 +129,7 @@ class MemcachedCache extends Cache ...@@ -129,7 +129,7 @@ class MemcachedCache extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function hasItem($key) public function hasItem(string $key): bool
{ {
return $this->memcache->checkKey($this->getCacheKey($key)); return $this->memcache->checkKey($this->getCacheKey($key));
} }
...@@ -137,7 +137,7 @@ class MemcachedCache extends Cache ...@@ -137,7 +137,7 @@ class MemcachedCache extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function save(CacheItemInterface $item) public function save(CacheItemInterface $item): bool
{ {
$expiration = $this->getExpiration($item); $expiration = $this->getExpiration($item);
if ($expiration < 1) { if ($expiration < 1) {
......
...@@ -19,11 +19,11 @@ class MemoryCache extends Cache ...@@ -19,11 +19,11 @@ class MemoryCache extends Cache
/** /**
* Expires just a single key. * Expires just a single key.
* *
* @param string the key * @param string $arg the key
*/ */
public function expire($key) public function expire($arg)
{ {
unset($this->memory_cache[$key]); unset($this->memory_cache[$arg]);
} }
/** /**
...@@ -52,7 +52,7 @@ class MemoryCache extends Cache ...@@ -52,7 +52,7 @@ class MemoryCache extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function getItem($key) public function getItem(string $key): CacheItemInterface
{ {
$item = new Item($key); $item = new Item($key);
if (!isset($this->memory_cache[$key])) { if (!isset($this->memory_cache[$key])) {
...@@ -75,7 +75,7 @@ class MemoryCache extends Cache ...@@ -75,7 +75,7 @@ class MemoryCache extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function hasItem($key) public function hasItem(string $key): bool
{ {
return isset($this->memory_cache[$key]) return isset($this->memory_cache[$key])
&& $this->memory_cache[$key]['expires'] < time(); && $this->memory_cache[$key]['expires'] < time();
...@@ -84,7 +84,7 @@ class MemoryCache extends Cache ...@@ -84,7 +84,7 @@ class MemoryCache extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function save(CacheItemInterface $item) public function save(CacheItemInterface $item): bool
{ {
$expiration = $this->getExpiration($item); $expiration = $this->getExpiration($item);
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace Studip\Cache; namespace Studip\Cache;
use Psr\Cache\CacheItemInterface;
use StudipCacheOperation; use StudipCacheOperation;
/** /**
...@@ -39,20 +40,20 @@ class Proxy extends Cache ...@@ -39,20 +40,20 @@ class Proxy extends Cache
/** /**
* Expires just a single key. * 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)) { if (in_array('expire', $this->proxy_these)) {
try { try {
$operation = new StudipCacheOperation([$key, 'expire']); $operation = new StudipCacheOperation([$arg, 'expire']);
$operation->parameters = serialize([]); $operation->parameters = serialize([]);
$operation->store(); $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 ...@@ -65,7 +66,7 @@ class Proxy extends Cache
$operation = new StudipCacheOperation(['', 'flush']); $operation = new StudipCacheOperation(['', 'flush']);
$operation->parameters = serialize([]); $operation->parameters = serialize([]);
$operation->store(); $operation->store();
} catch (\Exception $e) { } catch (\Exception) {
} }
} }
...@@ -90,7 +91,7 @@ class Proxy extends Cache ...@@ -90,7 +91,7 @@ class Proxy extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function getItem($key) public function getItem(string $key): CacheItemInterface
{ {
return $this->actual_cache->getItem($key); return $this->actual_cache->getItem($key);
} }
...@@ -98,7 +99,7 @@ class Proxy extends Cache ...@@ -98,7 +99,7 @@ class Proxy extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function hasItem($key) public function hasItem(string $key): bool
{ {
return $this->actual_cache->hasItem($key); return $this->actual_cache->hasItem($key);
} }
...@@ -106,14 +107,14 @@ class Proxy extends Cache ...@@ -106,14 +107,14 @@ class Proxy extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function save(\Psr\Cache\CacheItemInterface $item) public function save(CacheItemInterface $item): bool
{ {
if (in_array('save', $this->proxy_these)) { if (in_array('save', $this->proxy_these)) {
try { try {
$operation = new StudipCacheOperation([$item->getKey(), 'save']); $operation = new StudipCacheOperation([$item->getKey(), 'save']);
$operation->parameters = serialize([$item]); $operation->parameters = serialize([$item]);
$operation->store(); $operation->store();
} catch (\Exception $e) { } catch (\Exception) {
} }
} }
......
...@@ -156,7 +156,7 @@ class RedisCache extends Cache ...@@ -156,7 +156,7 @@ class RedisCache extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function getItem($key) public function getItem(string $key): CacheItemInterface
{ {
$item = new Item($key); $item = new Item($key);
$real_key = $this->getCacheKey($key); $real_key = $this->getCacheKey($key);
...@@ -175,7 +175,7 @@ class RedisCache extends Cache ...@@ -175,7 +175,7 @@ class RedisCache extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function hasItem($key) public function hasItem(string $key): bool
{ {
$real_key = $this->getCacheKey($key); $real_key = $this->getCacheKey($key);
return $this->redis->get($real_key) !== null; return $this->redis->get($real_key) !== null;
...@@ -184,7 +184,7 @@ class RedisCache extends Cache ...@@ -184,7 +184,7 @@ class RedisCache extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function save(CacheItemInterface $item) public function save(CacheItemInterface $item): bool
{ {
$expiration = $this->getExpiration($item); $expiration = $this->getExpiration($item);
if ($expiration < 1) { if ($expiration < 1) {
......
...@@ -59,7 +59,7 @@ class Wrapper extends Cache ...@@ -59,7 +59,7 @@ class Wrapper extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function getItem($key) public function getItem(string $key): CacheItemInterface
{ {
$cached = $this->memory_cache->getItem($key); $cached = $this->memory_cache->getItem($key);
if ($cached->isHit()) { if ($cached->isHit()) {
...@@ -76,7 +76,7 @@ class Wrapper extends Cache ...@@ -76,7 +76,7 @@ class Wrapper extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function hasItem($key) public function hasItem(string $key): bool
{ {
return $this->actual_cache->hasItem($key); return $this->actual_cache->hasItem($key);
} }
...@@ -84,7 +84,7 @@ class Wrapper extends Cache ...@@ -84,7 +84,7 @@ class Wrapper extends Cache
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function save(CacheItemInterface $item) public function save(CacheItemInterface $item): bool
{ {
if ($this->actual_cache->save($item)) { if ($this->actual_cache->save($item)) {
return $this->memory_cache->save($item); return $this->memory_cache->save($item);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment