Skip to content

Commit

Permalink
reusing downloadAsStream
Browse files Browse the repository at this point in the history
  • Loading branch information
gediminas committed Oct 11, 2016
1 parent 4449398 commit 98e6fd1
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/Storage/StorageObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,13 +536,7 @@ public function rename($name, array $options = [])
*/
public function downloadAsString(array $options = [])
{
return (string) $this->connection->downloadObject(
$this->formatEncryptionHeaders(
$options
+ $this->encryptionData
+ $this->identity
)
);
return (string) $this->downloadAsStream($options);
}

/**
Expand Down Expand Up @@ -573,13 +567,7 @@ public function downloadToFile($path, array $options = [])
$destination = Psr7\stream_for(fopen($path, 'w'));

Psr7\copy_to_stream(
$this->connection->downloadObject(
$this->formatEncryptionHeaders(
$options
+ $this->encryptionData
+ $this->identity
)
),
$this->downloadAsStream($options),
$destination
);

Expand Down

0 comments on commit 98e6fd1

Please sign in to comment.