1.2.953. PSR-6 Usage

PSR-6 is the cache standard for PHP.

The goal of PSR-6 is to allow developers to create cache-aware libraries that can be integrated into existing frameworks and systems without the need for custom development.

It is supported by an set of interfaces, that one may use in the code.

<?php

namespace MyNamespace;

// MyCacheItem implements the PSR-7 CacheItemInterface.
// This MyCacheItem is more of a black hole than a real CacheItem.
class MyCacheItem implements \Psr\Cache\CacheItemInterface {
    public function getKey() {}
    public function get() {}
    public function isHit() {}
    public function set($value) {}
    public function expiresAt($expiration) {}
    public function expiresAfter($time) {}
}

?>

See also PSR-6 : Caching.

1.2.953.1. Specs

Short name

Psr/Psr6Usage

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