diff --git a/Parser/Client/Browser.php b/Parser/Client/Browser.php index 686ca5ec5d..214e3179e7 100644 --- a/Parser/Client/Browser.php +++ b/Parser/Client/Browser.php @@ -12,6 +12,7 @@ namespace DeviceDetector\Parser\Client; +use DeviceDetector\Cache\CacheInterface; use DeviceDetector\ClientHints; use DeviceDetector\Parser\Client\Browser\Engine; use DeviceDetector\Parser\Client\Hints\BrowserHints; @@ -663,6 +664,17 @@ public function setUserAgent(string $ua): void $this->browserHints->setUserAgent($ua); } + /** + * Sets the Cache class + * + * @param CacheInterface $cache + */ + public function setCache(CacheInterface $cache): void + { + parent::setCache($cache); + $this->browserHints->setCache($cache); + } + /** * Returns list of all available browsers * @return array diff --git a/Parser/Client/MobileApp.php b/Parser/Client/MobileApp.php index 84f1145f52..eb4abe198e 100644 --- a/Parser/Client/MobileApp.php +++ b/Parser/Client/MobileApp.php @@ -12,6 +12,7 @@ namespace DeviceDetector\Parser\Client; +use DeviceDetector\Cache\CacheInterface; use DeviceDetector\ClientHints; use DeviceDetector\Parser\Client\Hints\AppHints; @@ -71,6 +72,17 @@ public function setUserAgent(string $ua): void $this->appHints->setUserAgent($ua); } + /** + * Sets the Cache class + * + * @param CacheInterface $cache + */ + public function setCache(CacheInterface $cache): void + { + parent::setCache($cache); + $this->appHints->setCache($cache); + } + /** * Parses the current UA and checks whether it contains any client information * See parent::parse() for more details.