| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | 28 | protected function registerStorage() |
|
| 47 | { |
||
| 48 | 28 | switch (true) { |
|
| 49 | 28 | case $this->config['storage_class'] instanceof StorageInterface: |
|
| 50 | 2 | $this->storage = $this->config['storage_class']; |
|
| 51 | 2 | break; |
|
| 52 | |||
| 53 | 26 | case $this->config['storage_class'] === File::class: |
|
| 54 | 26 | case \is_string($this->config['storage_class']): |
|
| 55 | 24 | $this->factoryStorage(); |
|
| 56 | 24 | break; |
|
| 57 | |||
| 58 | 2 | default: |
|
| 59 | 2 | throw new CacheException('Incorrect storage type: ' . \get_class($this->storage)); |
|
| 60 | 2 | } |
|
| 61 | |||
| 62 | 26 | return $this; |
|
| 63 | } |
||
| 81 |