1.2.958. PSR-16 Usage¶
PSR-16 describes a simple yet extensible interface for a cache item and a cache driver. It is supported by an set of interfaces, that one may use in the code.
<?php
namespace My\SimpleCache;
// MyCache implements the PSR-16 Simple cache.
// MyCache is more of a black hole than a real cache.
class MyCache implements Psr\SimpleCache\CacheInterface {
public function get($key, $default = null) {}
public function set($key, $value, $ttl = null) {}
public function delete($key) {}
public function clear() {}
public function getMultiple($keys, $default = null) {}
public function setMultiple($values, $ttl = null) {}
public function deleteMultiple($keys) {}
public function has($key) {}
}
?>
See also PSR-16 : Common Interface for Caching Libraries.
1.2.958.1. Connex PHP features¶
1.2.958.1.1. Specs¶
Short name |
Psr/Psr16Usage |
Rulesets |
|
Exakat since |
0.11.6 |
PHP Version |
All |
Severity |
|
Time To Fix |
|
Precision |
Very high |
Available in |