| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.0312 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | 14 | public static function create($cache): StorageInterface |
|
| 25 | { |
||
| 26 | 14 | if ($cache instanceof StorageInterface) { |
|
| 27 | return $cache; |
||
| 28 | } |
||
| 29 | |||
| 30 | 14 | if ($cache instanceof CacheInterface) { |
|
| 31 | 1 | return new Psr16CacheStorage($cache); |
|
| 32 | } |
||
| 33 | |||
| 34 | 13 | if ($cache instanceof CacheItemPoolInterface) { |
|
| 35 | 1 | return new Psr6CacheStorage($cache); |
|
| 36 | } |
||
| 37 | |||
| 38 | 12 | return new RuntimeStorage(); |
|
| 39 | } |
||
| 41 |