Factory.php
2 years ago
Lock.php
2 years ago
LockProvider.php
2 years ago
LockTimeoutException.php
2 years ago
Repository.php
3 weeks ago
Store.php
2 years ago
Repository.php
107 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWPSCOPED\Illuminate\Contracts\Cache; |
| 4 | |
| 5 | use Closure; |
| 6 | use IAWPSCOPED\Psr\SimpleCache\CacheInterface; |
| 7 | /** @internal */ |
| 8 | interface Repository extends CacheInterface |
| 9 | { |
| 10 | /** |
| 11 | * Retrieve an item from the cache and delete it. |
| 12 | * |
| 13 | * @template TCacheValue |
| 14 | * |
| 15 | * @param array|string $key |
| 16 | * @param TCacheValue|(\Closure(): TCacheValue) $default |
| 17 | * @return (TCacheValue is null ? mixed : TCacheValue) |
| 18 | */ |
| 19 | public function pull($key, $default = null); |
| 20 | /** |
| 21 | * Store an item in the cache. |
| 22 | * |
| 23 | * @param string $key |
| 24 | * @param mixed $value |
| 25 | * @param \DateTimeInterface|\DateInterval|int|null $ttl |
| 26 | * @return bool |
| 27 | */ |
| 28 | public function put($key, $value, $ttl = null); |
| 29 | /** |
| 30 | * Store an item in the cache if the key does not exist. |
| 31 | * |
| 32 | * @param string $key |
| 33 | * @param mixed $value |
| 34 | * @param \DateTimeInterface|\DateInterval|int|null $ttl |
| 35 | * @return bool |
| 36 | */ |
| 37 | public function add($key, $value, $ttl = null); |
| 38 | /** |
| 39 | * Increment the value of an item in the cache. |
| 40 | * |
| 41 | * @param string $key |
| 42 | * @param mixed $value |
| 43 | * @return int|bool |
| 44 | */ |
| 45 | public function increment($key, $value = 1); |
| 46 | /** |
| 47 | * Decrement the value of an item in the cache. |
| 48 | * |
| 49 | * @param string $key |
| 50 | * @param mixed $value |
| 51 | * @return int|bool |
| 52 | */ |
| 53 | public function decrement($key, $value = 1); |
| 54 | /** |
| 55 | * Store an item in the cache indefinitely. |
| 56 | * |
| 57 | * @param string $key |
| 58 | * @param mixed $value |
| 59 | * @return bool |
| 60 | */ |
| 61 | public function forever($key, $value); |
| 62 | /** |
| 63 | * Get an item from the cache, or execute the given Closure and store the result. |
| 64 | * |
| 65 | * @template TCacheValue |
| 66 | * |
| 67 | * @param string $key |
| 68 | * @param \DateTimeInterface|\DateInterval|int|null $ttl |
| 69 | * @param \Closure(): TCacheValue $callback |
| 70 | * @return TCacheValue |
| 71 | */ |
| 72 | public function remember($key, $ttl, Closure $callback); |
| 73 | /** |
| 74 | * Get an item from the cache, or execute the given Closure and store the result forever. |
| 75 | * |
| 76 | * @template TCacheValue |
| 77 | * |
| 78 | * @param string $key |
| 79 | * @param \Closure(): TCacheValue $callback |
| 80 | * @return TCacheValue |
| 81 | */ |
| 82 | public function sear($key, Closure $callback); |
| 83 | /** |
| 84 | * Get an item from the cache, or execute the given Closure and store the result forever. |
| 85 | * |
| 86 | * @template TCacheValue |
| 87 | * |
| 88 | * @param string $key |
| 89 | * @param \Closure(): TCacheValue $callback |
| 90 | * @return TCacheValue |
| 91 | */ |
| 92 | public function rememberForever($key, Closure $callback); |
| 93 | /** |
| 94 | * Remove an item from the cache. |
| 95 | * |
| 96 | * @param string $key |
| 97 | * @return bool |
| 98 | */ |
| 99 | public function forget($key); |
| 100 | /** |
| 101 | * Get the cache store implementation. |
| 102 | * |
| 103 | * @return \Illuminate\Contracts\Cache\Store |
| 104 | */ |
| 105 | public function getStore(); |
| 106 | } |
| 107 |