Upgrade to 3.8.0

This commit is contained in:
Bastian Allgeier
2022-10-06 10:11:54 +02:00
parent a9ed4e45ca
commit 7d168aae58
332 changed files with 26337 additions and 21977 deletions

View File

@@ -15,9 +15,17 @@ class MemoryCache extends Cache
{
/**
* Cache data
* @var array
*/
protected $store = [];
protected array $store = [];
/**
* Returns whether the cache is ready to
* store values
*/
public function enabled(): bool
{
return true;
}
/**
* Writes an item to the cache for a given number of minutes and
@@ -27,11 +35,6 @@ class MemoryCache extends Cache
* // put an item in the cache for 15 minutes
* $cache->set('value', 'my value', 15);
* </code>
*
* @param string $key
* @param mixed $value
* @param int $minutes
* @return bool
*/
public function set(string $key, $value, int $minutes = 0): bool
{
@@ -42,11 +45,8 @@ class MemoryCache extends Cache
/**
* Internal method to retrieve the raw cache value;
* needs to return a Value object or null if not found
*
* @param string $key
* @return \Kirby\Cache\Value|null
*/
public function retrieve(string $key)
public function retrieve(string $key): Value|null
{
return $this->store[$key] ?? null;
}
@@ -54,25 +54,20 @@ class MemoryCache extends Cache
/**
* Removes an item from the cache and returns
* whether the operation was successful
*
* @param string $key
* @return bool
*/
public function remove(string $key): bool
{
if (isset($this->store[$key])) {
unset($this->store[$key]);
return true;
} else {
return false;
}
return false;
}
/**
* Flushes the entire cache and returns
* whether the operation was successful
*
* @return bool
*/
public function flush(): bool
{