Created
March 5, 2021 13:25
-
-
Save arturssmirnovs/f88beff6a6acb91b45a2a148feff3e9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface CacheInterface { | |
/** | |
* Get cached entry if exists | |
* | |
* @param string $key | |
* @return mixed|null | |
*/ | |
public function get(string $key); | |
/** | |
* Set cached entry by specifying key and value and duration in ms. | |
* | |
* @param string $key | |
* @param $value | |
* @param int $duration | |
* @return mixed | |
*/ | |
public function set(string $key, $value, int $duration); | |
/** | |
* Delete cached entry | |
* | |
* @param string $key | |
* @return boolean | |
*/ | |
public function delete(string $key); | |
/** | |
* Check if cached entry exists | |
* | |
* @param string $key | |
* @return boolean | |
*/ | |
public function exists(string $key); | |
/** | |
* Clear all cached entries | |
* | |
* @return mixed | |
*/ | |
public function clear(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment