class CacheDecorator in Auth0 Single Sign On 8.2
Hierarchy
- class \Auth0\Tests\CacheDecorator implements CacheHandler
Expanded class hierarchy of CacheDecorator
1 file declares its use of CacheDecorator
- JWKTests.php in vendor/
auth0/ auth0-php/ tests/ API/ Helpers/ JWKTests.php
File
- vendor/
auth0/ auth0-php/ tests/ Helpers/ Cache/ CacheDecorator.php, line 7
Namespace
Auth0\TestsView source
class CacheDecorator implements CacheHandler {
protected $cache;
protected $counter = [];
public function __construct(CacheHandler $cache) {
$this->cache = $cache;
}
public function get($key) {
$this
->addCount('get');
return $this->cache
->get($key);
}
public function delete($key) {
$this
->addCount('delete');
return $this->cache
->delete($key);
}
public function set($key, $value) {
$this
->addCount('set');
return $this->cache
->set($key, $value);
}
private function addCount($method) {
if (!isset($this->counter[$method])) {
$this->counter[$method] = 0;
}
$this->counter[$method]++;
}
public function count($method) {
if (!isset($this->counter[$method])) {
return null;
}
return $this->counter[$method];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheDecorator:: |
protected | property | ||
CacheDecorator:: |
protected | property | ||
CacheDecorator:: |
private | function | ||
CacheDecorator:: |
public | function | ||
CacheDecorator:: |
public | function |
Overrides CacheHandler:: |
|
CacheDecorator:: |
public | function |
Overrides CacheHandler:: |
|
CacheDecorator:: |
public | function |
Overrides CacheHandler:: |
|
CacheDecorator:: |
public | function |