mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-31 15:30:01 +02:00
refactor: move cache logic into the factory (#2884)
This commit is contained in:
parent
5b9b579652
commit
321ec7c8c1
10 changed files with 16 additions and 15 deletions
|
@ -29,10 +29,11 @@ class CacheFactory
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $name The name of the cache e.g. "File", "Memcached" or "SQLite"
|
||||
* @param string|null $name The name of the cache e.g. "File", "Memcached" or "SQLite"
|
||||
*/
|
||||
public function create(string $name): CacheInterface
|
||||
public function create(string $name = null): CacheInterface
|
||||
{
|
||||
$name ??= Configuration::getConfig('cache', 'type');
|
||||
$name = $this->sanitizeCacheName($name) . 'Cache';
|
||||
|
||||
if (! preg_match('/^[A-Z][a-zA-Z0-9-]*$/', $name)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue