Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 16 |
|
0.00% |
0 / 16 |
CRAP | |
0.00% |
0 / 1 |
| Stream | |
0.00% |
0 / 16 |
|
0.00% |
0 / 16 |
272 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| __toString | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| detach | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getSize | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| tell | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| eof | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| isSeekable | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| seek | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| rewind | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| isWritable | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| write | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| isReadable | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| read | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getContents | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getMetadata | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| close | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace pvc\http\psr7; |
| 4 | |
| 5 | use Psr\Http\Message\StreamInterface; |
| 6 | use GuzzleHttp\Psr7\Stream as GuzzleStream; |
| 7 | |
| 8 | class Stream implements StreamInterface |
| 9 | { |
| 10 | public function __construct (protected GuzzleStream $stream) {} |
| 11 | |
| 12 | public function __toString(): string |
| 13 | { |
| 14 | return $this->stream->__toString(); |
| 15 | } |
| 16 | |
| 17 | public function detach() |
| 18 | { |
| 19 | return $this->stream->detach(); |
| 20 | } |
| 21 | |
| 22 | public function getSize(): ?int |
| 23 | { |
| 24 | return $this->stream->getSize(); |
| 25 | } |
| 26 | |
| 27 | public function tell(): int |
| 28 | { |
| 29 | return $this->stream->tell(); |
| 30 | } |
| 31 | |
| 32 | public function eof(): bool |
| 33 | { |
| 34 | return $this->stream->eof(); |
| 35 | } |
| 36 | |
| 37 | public function isSeekable(): bool |
| 38 | { |
| 39 | return $this->stream->isSeekable(); |
| 40 | } |
| 41 | |
| 42 | public function seek(int $offset, int $whence = SEEK_SET): void |
| 43 | { |
| 44 | $this->stream->seek($offset, $whence); |
| 45 | } |
| 46 | |
| 47 | public function rewind(): void |
| 48 | { |
| 49 | $this->stream->rewind(); |
| 50 | } |
| 51 | |
| 52 | public function isWritable(): bool |
| 53 | { |
| 54 | return $this->stream->isWritable(); |
| 55 | } |
| 56 | |
| 57 | public function write(string $string): int |
| 58 | { |
| 59 | return $this->stream->write($string); |
| 60 | } |
| 61 | |
| 62 | public function isReadable(): bool |
| 63 | { |
| 64 | return $this->stream->isReadable(); |
| 65 | } |
| 66 | |
| 67 | public function read(int $length): string |
| 68 | { |
| 69 | return $this->stream->read($length); |
| 70 | } |
| 71 | |
| 72 | public function getContents(): string |
| 73 | { |
| 74 | return $this->stream->getContents(); |
| 75 | } |
| 76 | |
| 77 | public function getMetadata(?string $key = null) |
| 78 | { |
| 79 | $this->stream->getMetadata(); |
| 80 | } |
| 81 | |
| 82 | public function close(): void |
| 83 | { |
| 84 | $this->stream->close(); |
| 85 | } |
| 86 | } |