src/CachePlugin.php
protected function createResponseFromCacheItem(CacheItemInterface $cacheItem)
    {
        $data = $cacheItem->get();

        $response = $data['response'];
        $stream = $this->streamFactory->createStream($data['body']);

        try {
            $stream->rewind();
        } catch (Exception $e) {
            throw new RewindStreamException('Cannot rewind stream.', 0, $e);
        }

        $response = $response->withBody($stream);

        return $response;
    }
protected function createResponseFromCacheItem(CacheItemInterface $cacheItem)
    {
        $data = $cacheItem->get();

        $response = $data['response'];
        $stream = $this->streamFactory->createStream($data['body']);

        try {
            $stream->rewind();
        } catch (Exception $e) {
            throw new RewindStreamException('Cannot rewind stream.', 0, $e);
        }

        $response = $response->withBody($stream);

        return $response;
    }
protected function createResponseFromCacheItem ( CacheItemInterface $ cacheItem ) { $ data = $ cacheItem -> get ( ) ; $ response = $ data [ 'response' ] ; $ stream = $ this -> streamFactory -> createStream ( $ data [ 'body' ] ) ; try { $ stream -> rewind ( ) ; } catch ( Exception $ e ) { throw new RewindStreamException ( 'Cannot rewind stream.' , 0 , $ e ) ; } $ response = $ response -> withBody ( $ stream ) ; return $ response ; }
Create a response from a cache item.

@param \Psr\Cache\CacheItemInterface $cacheItem

@return \Psr\Http\Message\ResponseInterface
Create a response from a cache item .