diff options
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); } } |