From 66c08aed6dd89340ab4a9d2a70f82c23392c0532 Mon Sep 17 00:00:00 2001 From: Wouter de Geringel <118986203+WouterDeGeringel@users.noreply.github.com> Date: Fri, 20 Jun 2025 12:19:23 +0200 Subject: [PATCH 1/3] Update OneDriveAdapter.php Updated read method to work with the updated readStream method --- src/OneDriveAdapter.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/OneDriveAdapter.php b/src/OneDriveAdapter.php index 31ee382..dd872dd 100644 --- a/src/OneDriveAdapter.php +++ b/src/OneDriveAdapter.php @@ -251,14 +251,11 @@ private function writeChunk(Http $http, string $upload_url, int $file_size, stri 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']; + + stream_get_contents($stream); } catch (Exception $e) { throw new Exception($e); } From e945410409b04fd19f85bd1b48bdeb5a6e08afcf Mon Sep 17 00:00:00 2001 From: Wouter de Geringel <118986203+WouterDeGeringel@users.noreply.github.com> Date: Fri, 20 Jun 2025 14:26:49 +0200 Subject: [PATCH 2/3] Update OneDriveAdapter.php Removed read method return type --- src/OneDriveAdapter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OneDriveAdapter.php b/src/OneDriveAdapter.php index dd872dd..ecca049 100644 --- a/src/OneDriveAdapter.php +++ b/src/OneDriveAdapter.php @@ -248,7 +248,7 @@ 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) { try { if (!($stream = $this->readStream($path))) { From 97dc2b8772a662ffd4b2026764309f226b68bbd7 Mon Sep 17 00:00:00 2001 From: Wouter de Geringel <118986203+WouterDeGeringel@users.noreply.github.com> Date: Fri, 20 Jun 2025 14:29:07 +0200 Subject: [PATCH 3/3] Update OneDriveAdapter.php read method now returns stream --- src/OneDriveAdapter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OneDriveAdapter.php b/src/OneDriveAdapter.php index ecca049..5e0d6d6 100644 --- a/src/OneDriveAdapter.php +++ b/src/OneDriveAdapter.php @@ -248,14 +248,14 @@ private function writeChunk(Http $http, string $upload_url, int $file_size, stri /** * @throws Exception|GuzzleException */ - public function read(string $path) + public function read(string $path):string { try { if (!($stream = $this->readStream($path))) { throw new UnableToReadFile('Unable to read file at ' . $path); } - stream_get_contents($stream); + return stream_get_contents($stream); } catch (Exception $e) { throw new Exception($e); }