Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
namespace Aws\Handler\GuzzleV5;
3
 
4
use GuzzleHttp\Stream\StreamDecoratorTrait;
5
use GuzzleHttp\Stream\StreamInterface as GuzzleStreamInterface;
6
use Psr\Http\Message\StreamInterface as Psr7StreamInterface;
7
 
8
/**
9
 * Adapts a Guzzle 5 Stream to a PSR-7 Stream.
10
 *
11
 * @codeCoverageIgnore
12
 */
13
class PsrStream implements Psr7StreamInterface
14
{
15
    use StreamDecoratorTrait;
16
 
17
    /** @var GuzzleStreamInterface */
18
    private $stream;
19
 
20
    public function __construct(GuzzleStreamInterface $stream)
21
    {
22
        $this->stream = $stream;
23
    }
24
 
25
    public function rewind()
26
    {
27
        $this->stream->seek(0);
28
    }
29
 
30
    public function getContents()
31
    {
32
        return $this->stream->getContents();
33
    }
34
}