We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 121bac6 commit 4377fd4Copy full SHA for 4377fd4
1 file changed
CallableStream.php
@@ -21,7 +21,6 @@
21
22
class CallableStream implements StreamInterface
23
{
24
-
25
/** @var callable */
26
private $callable;
27
@@ -116,7 +115,7 @@ public function read($length): string
116
115
117
public function getContents(): string
118
119
- return $this->read(1048576); // 1MB
+ return $this->read(65536); // 64KB
120
}
121
122
public function getMetadata($key = null)
@@ -153,12 +152,11 @@ private function reader(int $length): Generator
153
152
if (false === @fwrite($resource, ($this->callable)())) {
154
throw new RuntimeException('Cannot write to stream');
155
156
- fseek($resource, 0);
157
+ fseek($resource, 0);
158
while (false === feof($resource)) {
159
yield fread($resource, $length);
160
161
162
fclose($resource);
163
164
0 commit comments