+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
+ | Copyright CiviCRM LLC (c) 2004-2020 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC (c) 2004-2020
*/
/**
*/
class CRM_Utils_Cache_ArrayDecorator implements CRM_Utils_Cache_Interface {
- use CRM_Utils_Cache_NaiveMultipleTrait; // TODO Consider native implementation.
+ // TODO Consider native implementation.
+ use CRM_Utils_Cache_NaiveMultipleTrait;
/**
* @var int
}
public function get($key, $default = NULL) {
+ CRM_Utils_Cache::assertValidKey($key);
if (array_key_exists($key, $this->values) && $this->expires[$key] > CRM_Utils_Time::getTimeRaw()) {
return $this->reobjectify($this->values[$key]);
}
}
public function delete($key) {
+ CRM_Utils_Cache::assertValidKey($key);
unset($this->values[$key]);
unset($this->expires[$key]);
return $this->delegate->delete($key);
}
public function has($key) {
+ CRM_Utils_Cache::assertValidKey($key);
if (array_key_exists($key, $this->values) && $this->expires[$key] > CRM_Utils_Time::getTimeRaw()) {
return TRUE;
}