eee
This commit is contained in:
@@ -8,9 +8,16 @@ use Psr\Http\Message\StreamInterface;
|
|||||||
class Stream implements StreamInterface
|
class Stream implements StreamInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
public string $content = '';
|
|
||||||
|
/**
|
||||||
|
* @var resource|string
|
||||||
|
*/
|
||||||
|
public mixed $content = '';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
public int $size = 0;
|
public int $size = 0;
|
||||||
|
|
||||||
|
|
||||||
@@ -178,10 +185,10 @@ class Stream implements StreamInterface
|
|||||||
// TODO: Implement write() method.
|
// TODO: Implement write() method.
|
||||||
if (is_resource($this->content)) {
|
if (is_resource($this->content)) {
|
||||||
$this->content = fopen($string, 'wr');
|
$this->content = fopen($string, 'wr');
|
||||||
$this->size = filesize($string);
|
// $this->size = filesize($string);
|
||||||
} else {
|
} else {
|
||||||
$this->content = $string;
|
$this->content = $string;
|
||||||
$this->size = mb_strlen($string);
|
// $this->size = mb_strlen($string);
|
||||||
}
|
}
|
||||||
return $this->size;
|
return $this->size;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user