1
0
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:
Marc Alexander
2022-12-27 16:12:53 +01:00
parent b855b8a5a5
commit 83cb41e72a
15 changed files with 153 additions and 119 deletions

View File

@@ -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;