| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | 3 | public function get($id) |
|
| 45 | { |
||
| 46 | 3 | if (empty($id)) { |
|
| 47 | 1 | return $this->cacheMapper->get('memory', []); |
|
| 48 | } |
||
| 49 | |||
| 50 | 2 | if (!$this->has($id)) { |
|
| 51 | 1 | throw new UnknownCacheException( |
|
| 52 | 1 | 'Unable to locate cache '.$id.'. Please check your configuration.' |
|
| 53 | ); |
||
| 54 | } |
||
| 55 | |||
| 56 | 1 | $cacheConfig = $this->getConfig()->getCacheConfig($id); |
|
| 57 | 1 | return $this->cacheMapper->get( |
|
| 58 | 1 | $cacheConfig->getType(), |
|
| 59 | 1 | $cacheConfig->getOptions() |
|
| 60 | ); |
||
| 61 | } |
||
| 62 | |||
| 73 |