Conditions | 9 |
Paths | 8 |
Total Lines | 22 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 9 |
Changes | 0 |
1 | <?php |
||
10 | 5 | public function getFactoryClassName(string $type) |
|
11 | { |
||
12 | 5 | if (class_exists($type) && $type != 'memcached') { |
|
13 | 1 | return $type; |
|
14 | } |
||
15 | |||
16 | switch ($type) { |
||
17 | 4 | case 'adaptor': |
|
18 | 1 | case 'adapter': |
|
19 | 3 | return AdaptorCacheFactory::class; |
|
20 | 1 | case 'psr6': |
|
21 | 2 | return Psr6CacheFactory::class; |
|
22 | 1 | case 'memory': |
|
23 | return MemoryCacheFactory::class; |
||
24 | case 'predis': |
||
25 | 1 | return PredisCacheFactory::class; |
|
26 | case 'memcached': |
||
27 | return MemcachedCacheFactory::class; |
||
28 | } |
||
29 | |||
30 | return null; |
||
31 | } |
||
32 | } |
||
33 |