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