for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Nip\Form\Traits;
/**
* Trait HasCacheTrait
* @package Nip\Form\Traits
*/
trait HasCacheTrait
{
protected $_cache;
* @param $key
* @param null $default
$default
null
* @return mixed
public function getCache($key, $default = null)
if (!isset($this->_cache[$key])) {
return $default;
}
return $this->_cache[$key];
* @param string $key
* @param $value
public function setCache($key, $value)
$this->_cache[$key] = $value;
* @return bool
public function isCache($key)
return isset($this->_cache[$key]);