ApcuCacheFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 2
c 1
b 0
f 0
dl 0
loc 9
ccs 0
cts 0
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A getInstance() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpMyAdmin\MoTranslator\Cache;
6
7
use PhpMyAdmin\MoTranslator\MoParser;
8
9
final class ApcuCacheFactory implements CacheFactoryInterface
10
{
11
    public function __construct(private int $ttl = 0, private bool $reloadOnMiss = true, private string $prefix = 'mo_')
12
    {
13
    }
14
15
    public function getInstance(MoParser $parser, string $locale, string $domain): CacheInterface
16
    {
17
        return new ApcuCache($parser, $locale, $domain, $this->ttl, $this->reloadOnMiss, $this->prefix);
18 28
    }
19
}
20