| Conditions | 3 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 26 | public function getItem($key, $driver = null, $ttl = null) { |
||
| 27 | $finalDriver = ($driver !== null) ? $driver : $this->defaultDriver; |
||
| 28 | |||
| 29 | $pool = $this->getItemPool($finalDriver); |
||
| 30 | $item = $pool->getItem($key); |
||
| 31 | |||
| 32 | // In this case, the pool returned a new CacheItem |
||
| 33 | if($item->get() === null) { |
||
|
|
|||
| 34 | $item->expiresAfter($ttl); |
||
| 35 | } |
||
| 36 | return $item; |
||
| 37 | } |
||
| 38 | |||
| 51 | } |