Conditions | 4 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
39 | private function getFromCache($key, MessageInterface $message) |
||
40 | { |
||
41 | if ($this->cache) { |
||
42 | $item = $this->cache->getItem($key); |
||
43 | |||
44 | if ($item->isHit()) { |
||
45 | list($headers, $body) = $item->get(); |
||
46 | |||
47 | foreach ($headers as $name => $header) { |
||
48 | $message = $message->withHeader($name, $header); |
||
49 | } |
||
50 | |||
51 | $message->getBody()->write($body); |
||
52 | |||
53 | return $message; |
||
54 | } |
||
55 | } |
||
56 | |||
57 | return false; |
||
58 | } |
||
59 | |||
80 |