From d90a579272e50c5909cefbd5eed0da995587d5b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 17 Oct 2023 21:03:47 +0800 Subject: [PATCH] eee --- src/Constrict/Stream.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Constrict/Stream.php b/src/Constrict/Stream.php index 948898f..3cab2c4 100644 --- a/src/Constrict/Stream.php +++ b/src/Constrict/Stream.php @@ -8,9 +8,16 @@ use Psr\Http\Message\StreamInterface; class Stream implements StreamInterface { - public string $content = ''; + + /** + * @var resource|string + */ + public mixed $content = ''; + /** + * @var int + */ public int $size = 0; @@ -178,10 +185,10 @@ class Stream implements StreamInterface // TODO: Implement write() method. if (is_resource($this->content)) { $this->content = fopen($string, 'wr'); - $this->size = filesize($string); +// $this->size = filesize($string); } else { $this->content = $string; - $this->size = mb_strlen($string); +// $this->size = mb_strlen($string); } return $this->size; }