mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-23 10:01:55 +02:00
[ticket/16955] Add stubs for cache classes and clean up
PHPBB3-16955
This commit is contained in:
30
tests/cache/cache_memory.php
vendored
30
tests/cache/cache_memory.php
vendored
@@ -23,40 +23,26 @@ class phpbb_cache_memory extends \phpbb\cache\driver\memory
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch an item from the cache
|
||||
*
|
||||
* @access protected
|
||||
* @param string $var Cache key
|
||||
* @return mixed Cached data
|
||||
*/
|
||||
function _read($var)
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
protected function _read(string $var)
|
||||
{
|
||||
return $this->data[$var] ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store data in the cache
|
||||
*
|
||||
* @access protected
|
||||
* @param string $var Cache key
|
||||
* @param mixed $data Data to store
|
||||
* @param int $ttl Time-to-live of cached data
|
||||
* @return bool True if the operation succeeded
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
function _write($var, $data, $ttl = 2592000)
|
||||
protected function _write(string $var, $data, int $ttl = 2592000): bool
|
||||
{
|
||||
$this->data[$var] = $data;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an item from the cache
|
||||
*
|
||||
* @access protected
|
||||
* @param string $var Cache key
|
||||
* @return bool True if the operation succeeded
|
||||
*/
|
||||
function _delete($var)
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
protected function _delete(string $var): bool
|
||||
{
|
||||
unset($this->data[$var]);
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user