Conditions | 3 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
35 | public function getItem($key, $driver = null, $ttl = null) { |
||
36 | $finalDriver = ($driver !== null) ? $driver : $this->defaultDriver; |
||
37 | |||
38 | $pool = $this->getItemPool($finalDriver); |
||
39 | $item = $pool->getItem($key); |
||
40 | |||
41 | // In this case, the pool returned a new CacheItem |
||
42 | if($item->get() === null) { |
||
|
|||
43 | $item->expiresAfter($ttl); |
||
44 | } |
||
45 | return $item; |
||
46 | } |
||
47 | |||
61 |