diff options
author | Andrew Dolgov <[email protected]> | 2023-10-20 16:44:35 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2023-10-20 16:44:35 +0300 |
commit | 8bec661288b276c98bdb0e773e5f4d5275dc4c87 (patch) | |
tree | 8617ebe581c62fc46a7881aa61801ebce9d3c603 /vendor/guzzlehttp/psr7/src/LazyOpenStream.php | |
parent | 540438c2eb5452bacad30c247906bfa287f2da1d (diff) |
Diffstat (limited to 'vendor/guzzlehttp/psr7/src/LazyOpenStream.php')
-rw-r--r-- | vendor/guzzlehttp/psr7/src/LazyOpenStream.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php index 5618331..f6c8490 100644 --- a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php +++ b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php @@ -10,7 +10,6 @@ use Psr\Http\Message\StreamInterface; * Lazily reads or writes to a file that is opened only after an IO operation * take place on the stream. */ -#[\AllowDynamicProperties] final class LazyOpenStream implements StreamInterface { use StreamDecoratorTrait; @@ -22,6 +21,11 @@ final class LazyOpenStream implements StreamInterface private $mode; /** + * @var StreamInterface + */ + private $stream; + + /** * @param string $filename File to lazily open * @param string $mode fopen mode to use when opening the stream */ @@ -29,6 +33,10 @@ final class LazyOpenStream implements StreamInterface { $this->filename = $filename; $this->mode = $mode; + + // unsetting the property forces the first access to go through + // __get(). + unset($this->stream); } /** |