| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,28 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+declare(strict_types=1); |
|
| 4 |
+ |
|
| 5 |
+namespace GuzzleHttp\Psr7; |
|
| 6 |
+ |
|
| 7 |
+use Psr\Http\Message\StreamInterface; |
|
| 8 |
+ |
|
| 9 |
+/** |
|
| 10 |
+ * Stream decorator that prevents a stream from being seeked. |
|
| 11 |
+ */ |
|
| 12 |
+final class NoSeekStream implements StreamInterface |
|
| 13 |
+{
|
|
| 14 |
+ use StreamDecoratorTrait; |
|
| 15 |
+ |
|
| 16 |
+ /** @var StreamInterface */ |
|
| 17 |
+ private $stream; |
|
| 18 |
+ |
|
| 19 |
+ public function seek($offset, $whence = SEEK_SET): void |
|
| 20 |
+ {
|
|
| 21 |
+ throw new \RuntimeException('Cannot seek a NoSeekStream');
|
|
| 22 |
+ } |
|
| 23 |
+ |
|
| 24 |
+ public function isSeekable(): bool |
|
| 25 |
+ {
|
|
| 26 |
+ return false; |
|
| 27 |
+ } |
|
| 28 |
+} |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,23 +0,0 @@ |
| 1 |
-<?php |
|
| 2 |
- |
|
| 3 |
-namespace GuzzleHttp\Psr7; |
|
| 4 |
- |
|
| 5 |
-use Psr\Http\Message\StreamInterface; |
|
| 6 |
- |
|
| 7 |
-/** |
|
| 8 |
- * Stream decorator that prevents a stream from being seeked |
|
| 9 |
- */ |
|
| 10 |
-class NoSeekStream implements StreamInterface |
|
| 11 |
-{
|
|
| 12 |
- use StreamDecoratorTrait; |
|
| 13 |
- |
|
| 14 |
- public function seek($offset, $whence = SEEK_SET) |
|
| 15 |
- {
|
|
| 16 |
- throw new \RuntimeException('Cannot seek a NoSeekStream');
|
|
| 17 |
- } |
|
| 18 |
- |
|
| 19 |
- public function isSeekable() |
|
| 20 |
- {
|
|
| 21 |
- return false; |
|
| 22 |
- } |
|
| 23 |
-} |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,23 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+namespace GuzzleHttp\Psr7; |
|
| 4 |
+ |
|
| 5 |
+use Psr\Http\Message\StreamInterface; |
|
| 6 |
+ |
|
| 7 |
+/** |
|
| 8 |
+ * Stream decorator that prevents a stream from being seeked |
|
| 9 |
+ */ |
|
| 10 |
+class NoSeekStream implements StreamInterface |
|
| 11 |
+{
|
|
| 12 |
+ use StreamDecoratorTrait; |
|
| 13 |
+ |
|
| 14 |
+ public function seek($offset, $whence = SEEK_SET) |
|
| 15 |
+ {
|
|
| 16 |
+ throw new \RuntimeException('Cannot seek a NoSeekStream');
|
|
| 17 |
+ } |
|
| 18 |
+ |
|
| 19 |
+ public function isSeekable() |
|
| 20 |
+ {
|
|
| 21 |
+ return false; |
|
| 22 |
+ } |
|
| 23 |
+} |