1<?php 2 3/** 4 * Device Detector - The Universal Device Detection library for parsing User Agents 5 * 6 * @link https://matomo.org 7 * 8 * @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later 9 */ 10 11declare(strict_types=1); 12 13namespace DeviceDetector\Cache; 14 15interface CacheInterface 16{ 17 /** 18 * @param string $id 19 * 20 * @return mixed 21 */ 22 public function fetch(string $id); 23 24 /** 25 * @param string $id 26 * 27 * @return bool 28 */ 29 public function contains(string $id): bool; 30 31 /** 32 * @param string $id 33 * @param mixed $data 34 * @param int $lifeTime 35 * 36 * @return bool 37 */ 38 public function save(string $id, $data, int $lifeTime = 0): bool; 39 40 /** 41 * @param string $id 42 * 43 * @return bool 44 */ 45 public function delete(string $id): bool; 46 47 /** 48 * @return bool 49 */ 50 public function flushAll(): bool; 51} 52