1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-09 02:06:32 +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

@@ -270,13 +270,33 @@ abstract class memory extends \phpbb\cache\driver\base
/**
* Check if a cache var exists
*
* @access protected
* @param string $var Cache key
*
* @return bool True if it exists, otherwise false
*/
function _isset($var)
protected function _isset(string $var): bool
{
// Most caches don't need to check
return true;
}
/**
* Remove an item from the cache
*
* @param string $var Cache key
*
* @return bool True if the operation succeeded
*/
abstract protected function _delete(string $var): bool;
/**
* Store data in the cache
*
* @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
*/
abstract protected function _write(string $var, $data, int $ttl = 2592000): bool;
}