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/aws/aws-sdk-php/src/HashingStream.php | |
parent | 540438c2eb5452bacad30c247906bfa287f2da1d (diff) |
Diffstat (limited to 'vendor/aws/aws-sdk-php/src/HashingStream.php')
-rw-r--r-- | vendor/aws/aws-sdk-php/src/HashingStream.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/vendor/aws/aws-sdk-php/src/HashingStream.php b/vendor/aws/aws-sdk-php/src/HashingStream.php index 779f3ac..6622178 100644 --- a/vendor/aws/aws-sdk-php/src/HashingStream.php +++ b/vendor/aws/aws-sdk-php/src/HashingStream.php @@ -11,6 +11,9 @@ class HashingStream implements StreamInterface { use StreamDecoratorTrait; + /** @var StreamInterface */ + private $stream; + /** @var HashInterface */ private $hash; @@ -33,7 +36,7 @@ class HashingStream implements StreamInterface $this->callback = $onComplete; } - public function read($length) + public function read($length): string { $data = $this->stream->read($length); $this->hash->update($data); @@ -47,14 +50,14 @@ class HashingStream implements StreamInterface return $data; } - public function seek($offset, $whence = SEEK_SET) + public function seek($offset, $whence = SEEK_SET): void { - if ($offset === 0) { - $this->hash->reset(); - return $this->stream->seek($offset); + // Seeking arbitrarily is not supported. + if ($offset !== 0) { + return; } - // Seeking arbitrarily is not supported. - return false; + $this->hash->reset(); + $this->stream->seek($offset); } } |