Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
29 | public function getItem(string $key, string $driver = null, int $ttl = null): CacheItemInterface |
||
30 | { |
||
31 | $finalDriver = ($driver !== null) ? $driver : $this->defaultDriver; |
||
32 | |||
33 | $pool = $this->getItemPool($finalDriver); |
||
34 | $item = $pool->getItem($key); |
||
35 | |||
36 | // In this case, the pool returned a new CacheItem |
||
37 | if ($item->get() === null) { |
||
38 | $item->expiresAfter($ttl); |
||
39 | } |
||
40 | return $item; |
||
41 | } |
||
42 | |||
52 |