mobileDetect = $mobileDetect; } /** * @inheritDoc */ public function isMobile(RequestInterface $request): bool { if (! $request instanceof Http) { return false; } $key = 'mobile'; if (! isset($this->cache[$key])) { $this->cache[$key] = $this->mobileDetect->isMobile(); } return $this->cache[$key]; } /** * @inheritDoc */ public function isTablet(RequestInterface $request): bool { if (! $request instanceof Http) { return false; } $key = 'tablet'; if (! isset($this->cache[$key])) { $this->cache[$key] = $this->mobileDetect->isTablet(); } return $this->cache[$key]; } }