PluginProbe
Auto Alt Text / trunk
Auto Alt Text vtrunk
3.0.3 2.8.2 1.3.1 1.3.2 2.0.0 2.1.0 2.1.1 2.2.0 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.7.0 2.8.0 2.8.1 All 28 releases
auto-alt-text / src / App / Infrastructure / Cache / CacheInterface.php

CacheInterface.php in Auto Alt Text trunk, at src/App/Infrastructure/Cache/CacheInterface.php

39 lines 877 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace AATXT\App\Infrastructure\Cache;
6
7 /**
8 * Minimal cache abstraction for short-lived key/value storage.
9 *
10 * Implementations wrap a backing store (e.g. WordPress transients) and allow
11 * dependency injection so consumers can be unit-tested without WordPress.
12 */
13 interface CacheInterface
14 {
15 /**
16 * Retrieve a value from the cache.
17 *
18 * @param string $key
19 * @return mixed|null Null when the key is missing.
20 */
21 public function get(string $key);
22
23 /**
24 * Store a value in the cache.
25 *
26 * @param string $key
27 * @param mixed $value
28 * @param int $ttl Time-to-live in seconds.
29 */
30 public function set(string $key, $value, int $ttl): void;
31
32 /**
33 * Remove a value from the cache.
34 *
35 * @param string $key
36 */
37 public function delete(string $key): void;
38 }
39