refacor: improve cache interface (#3492)

* fix: proper typehint on setScope

* refactor: type hint setKey()

* typehint
This commit is contained in:
Dag 2023-07-06 15:10:30 +02:00 committed by GitHub
parent f8801d8cb3
commit caac7f572c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 56 additions and 220 deletions

View file

@ -91,7 +91,7 @@ class DisplayAction implements ActionInterface
$cache = $cacheFactory->create();
$cache->setScope('');
$cache->purgeCache(86400); // 24 hours
$cache->purgeCache(86400);
$cache->setKey($cache_params);
$items = [];
@ -215,7 +215,7 @@ class DisplayAction implements ActionInterface
$cache = $cacheFactory->create();
$cache->setScope('error_reporting');
$cache->setkey([$bridgeName . '_' . $code]);
$cache->purgeCache(86400); // 24 hours
$cache->purgeCache(86400);
if ($report = $cache->loadData()) {
$report = Json::decode($report);
$report['time'] = time();