Improve doc blocks in cache drivers

This commit is contained in:
Hypolite Petovan 2018-09-25 22:51:41 -04:00
parent d1148f61ea
commit 640f76b05a
4 changed files with 48 additions and 6 deletions

View file

@ -13,6 +13,9 @@ use Friendica\Util\DateTimeFormat;
*/
class DatabaseCacheDriver extends AbstractCacheDriver implements ICacheDriver
{
/**
* (@inheritdoc)
*/
public function get($key)
{
$cache = DBA::selectFirst('cache', ['v'], ['`k` = ? AND `expires` >= ?', $key, DateTimeFormat::utcNow()]);
@ -32,6 +35,9 @@ class DatabaseCacheDriver extends AbstractCacheDriver implements ICacheDriver
return null;
}
/**
* (@inheritdoc)
*/
public function set($key, $value, $ttl = Cache::FIVE_MINUTES)
{
$fields = [
@ -43,11 +49,17 @@ class DatabaseCacheDriver extends AbstractCacheDriver implements ICacheDriver
return DBA::update('cache', $fields, ['k' => $key], true);
}
/**
* (@inheritdoc)
*/
public function delete($key)
{
return DBA::delete('cache', ['k' => $key]);
}
/**
* (@inheritdoc)
*/
public function clear($outdated = true)
{
if ($outdated) {