This commit is contained in:
2021-08-31 14:25:36 +08:00
parent ba6ed131db
commit 60d50d8ba5
+5 -3
View File
@@ -151,7 +151,6 @@ class Stream implements StreamInterface
}
/**
* @return bool
*/
@@ -165,9 +164,12 @@ class Stream implements StreamInterface
* @param int $length
* @return string
*/
public function read($length): string
public function read($length = -1): string
{
return substr($this->body, 0, $length);
if ($length > 0) {
return substr($this->body, 0, $length);
}
return $this->body;
}