for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Yiisoft\Cache;
use Yiisoft\Cache\Dependency\Dependency;
/**
* NullCache does not cache anything reporting success for all methods calls.
*
* By replacing it with some other cache component, one can quickly switch from
* non-caching mode to caching mode.
*/
final class NullCache implements CacheInterface
{
public function add($key, $value, $ttl = 0, Dependency $dependency = null): bool
return true;
}
public function deleteMultiple($keys): bool
public function set($key, $value, $ttl = null, Dependency $dependency = null): bool
public function get($key, $default = null)
return $default;
public function getMultiple($keys, $default = null): iterable
return array_fill_keys($keys, $default);
public function setMultiple($values, $ttl = null, Dependency $dependency = null): bool
public function addMultiple(array $values, $ttl = null, Dependency $dependency = null): bool
public function getOrSet($key, callable $callable, $ttl = null, Dependency $dependency = null)
return $callable($this);
public function delete($key): bool
public function clear(): bool
public function has($key): bool
return false;