diff --git a/src/OneDriveAdapter.php b/src/OneDriveAdapter.php index 31ee382..5e0d6d6 100644 --- a/src/OneDriveAdapter.php +++ b/src/OneDriveAdapter.php @@ -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); }