Created
October 14, 2013 19:13
-
-
Save guilhermeblanco/6980498 to your computer and use it in GitHub Desktop.
PSR-6: Simple Cache
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 | |
namespace Psr\Cache; | |
interface CacheInterface extends \ArrayAccess | |
{ | |
/** | |
* Retrieve a Cache Entry. | |
* | |
* @param string $key | |
* | |
* @return EntryInterface | |
*/ | |
public function get($key); | |
/** | |
* Define a Cache Entry. | |
* | |
* @param EntryInterface $entry | |
* | |
* @return boolean | |
*/ | |
public function set(EntryInterface $entry); | |
/** | |
* Remove a Cache Entry. | |
* | |
* @param string $key | |
* | |
* @return boolean | |
*/ | |
public function unset($key); | |
/** | |
* Check existance of a Cache Entry. | |
* | |
* @param string $key | |
* | |
* @return boolean | |
*/ | |
public function isset($key); | |
} |
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 | |
namespace Psr\Cache; | |
interface EntryInterface | |
{ | |
/** | |
* Retrieve the Cache Entry key. | |
* | |
* @return string | |
*/ | |
public function getKey(); | |
/** | |
* Define the Cache Entry key. | |
* | |
* @param string $key | |
*/ | |
public function setKey($key); | |
/** | |
* Retrieve the Cache Entry value. | |
*/ | |
public function getValue(); | |
/** | |
* Define the Cache Entry value. | |
* | |
* @param string $value | |
*/ | |
public function setValue($value); | |
/** | |
* Check if Cache Entry is stored. | |
* | |
* @return boolean | |
*/ | |
public function isStored(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment