diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-11-02 11:04:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-02 11:04:33 +0300 |
commit | b123a03f4c1e14afaebe3696b15b1f28cc06c728 (patch) | |
tree | c9976aaa10de41d725d8e5a842ae3ed352255179 /core/DeviceDetector | |
parent | 55753101ad1ebcfaa48ba1c94466c4499650fcf8 (diff) |
Require new major release of matomo/device-detector (#16636)
* Require new major release of matomo/device-detector (instead of piwik/device-detector)
* Adjust classname
* fix cache class
* update test files
* some more code adjustments
* update submodule
Diffstat (limited to 'core/DeviceDetector')
-rw-r--r-- | core/DeviceDetector/DeviceDetectorCache.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/DeviceDetector/DeviceDetectorCache.php b/core/DeviceDetector/DeviceDetectorCache.php index 474cab3ab1..3e85457cb5 100644 --- a/core/DeviceDetector/DeviceDetectorCache.php +++ b/core/DeviceDetector/DeviceDetectorCache.php @@ -17,7 +17,7 @@ use Piwik\Cache as PiwikCache; * * Static caching speeds up multiple detections in one request, which is the case when sending bulk requests */ -class DeviceDetectorCache implements \DeviceDetector\Cache\Cache +class DeviceDetectorCache implements \DeviceDetector\Cache\CacheInterface { protected static $staticCache = array(); @@ -61,7 +61,7 @@ class DeviceDetectorCache implements \DeviceDetector\Cache\Cache * @throws \Exception * @return bool True if the entry was successfully stored */ - public function save($id, $content, $ttl=0) + public function save($id, $content, $ttl=0): bool { if (empty($id)) { return false; @@ -69,15 +69,15 @@ class DeviceDetectorCache implements \DeviceDetector\Cache\Cache self::$staticCache[$id] = $content; - return $this->cache->save($id, $content, $this->ttl); + return (bool) $this->cache->save($id, $content, $this->ttl); } - public function contains($id) + public function contains($id): bool { return !empty(self::$staticCache[$id]) && $this->cache->contains($id); } - public function delete($id) + public function delete($id): bool { if (empty($id)) { return false; @@ -85,11 +85,11 @@ class DeviceDetectorCache implements \DeviceDetector\Cache\Cache unset(self::$staticCache[$id]); - return $this->cache->delete($id); + return (bool) $this->cache->delete($id); } - public function flushAll() + public function flushAll(): bool { - return $this->cache->flushAll(); + return (bool) $this->cache->flushAll(); } } |