private function getFromCache($key, MessageInterface $message)
    {
        if ($this->cache) {
            $item = $this->cache->getItem($key);

            if ($item->isHit()) {
                list($headers, $body) = $item->get();

                foreach ($headers as $name => $header) {
                    $message = $message->withHeader($name, $header);
                }

                $message->getBody()->write($body);

                return $message;
            }
        }

        return false;
    }
private function getFromCache($key, MessageInterface $message)
    {
        if ($this->cache) {
            $item = $this->cache->getItem($key);

            if ($item->isHit()) {
                list($headers, $body) = $item->get();

                foreach ($headers as $name => $header) {
                    $message = $message->withHeader($name, $header);
                }

                $message->getBody()->write($body);

                return $message;
            }
        }

        return false;
    }
private function getFromCache ( $ key , MessageInterface $ message ) { if ( $ this -> cache ) { $ item = $ this -> cache -> getItem ( $ key ) ; if ( $ item -> isHit ( ) ) { list ( $ headers , $ body ) = $ item -> get ( ) ; foreach ( $ headers as $ name => $ header ) { $ message = $ message -> withHeader ( $ name , $ header ) ; } $ message -> getBody ( ) -> write ( $ body ) ; return $ message ; } } return false ; }
Restore a message from the cache.

@param string           $key     The message key
@param MessageInterface $message

@return MessageInterface|false
Restore a message from the cache .