AnalystContract.php
11 months ago
CacheContract.php
11 months ago
HttpClientContract.php
11 months ago
RequestContract.php
11 months ago
RequestorContract.php
11 months ago
TrackerContract.php
11 months ago
CacheContract.php
48 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Analyst\Contracts; |
| 4 | |
| 5 | /** |
| 6 | * Interface CacheContract |
| 7 | * |
| 8 | * @since 1.1.5 |
| 9 | */ |
| 10 | interface CacheContract |
| 11 | { |
| 12 | /** |
| 13 | * Save value with given key |
| 14 | * |
| 15 | * @param string $key |
| 16 | * @param string $value |
| 17 | * |
| 18 | * @return static |
| 19 | */ |
| 20 | public function put($key, $value); |
| 21 | |
| 22 | /** |
| 23 | * Get value by given key |
| 24 | * |
| 25 | * @param $key |
| 26 | * |
| 27 | * @param null $default |
| 28 | * @return string |
| 29 | */ |
| 30 | public function get($key, $default = null); |
| 31 | |
| 32 | /** |
| 33 | * @param $key |
| 34 | * |
| 35 | * @return static |
| 36 | */ |
| 37 | public function delete($key); |
| 38 | |
| 39 | /** |
| 40 | * Should get value and remove it from cache |
| 41 | * |
| 42 | * @param $key |
| 43 | * @param null $default |
| 44 | * @return mixed |
| 45 | */ |
| 46 | public function pop($key, $default = null); |
| 47 | } |
| 48 |