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