1.2.951. 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.951.1. Specs

Short name

Psr/Psr16Usage

Rulesets

All, Appinfo, CE

Exakat since

0.11.6

PHP Version

All

Severity

Time To Fix

Precision

Very high

Features

psr

Available in

Entreprise Edition, Community Edition, Exakat Cloud