Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/OneDriveAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,14 @@ private function writeChunk(Http $http, string $upload_url, int $file_size, stri
/**
* @throws Exception|GuzzleException
*/
public function read(string $path): string
public function read(string $path):string
{
try {
if (!($object = $this->readStream($path))) {
if (!($stream = $this->readStream($path))) {
throw new UnableToReadFile('Unable to read file at ' . $path);
}

$object['contents'] = stream_get_contents($object['stream']);
unset($object['stream']);

return $object['contents'];

return stream_get_contents($stream);
} catch (Exception $e) {
throw new Exception($e);
}
Expand Down