From c27061859dce990f3c8806151be1aef35d3aee2e Mon Sep 17 00:00:00 2001 From: Karsten Dambekalns Date: Wed, 16 Nov 2022 10:02:47 +0100 Subject: [PATCH] Fix return type in S3Storage Two places declared `bool` as return type, but it actually needs to be `bool|resource`. Since that is not allowed in PHP 7, but the package is compatible with Flow 6.3 & 7.x, this removes the return type completely. Fixes #60 --- Classes/S3Storage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/S3Storage.php b/Classes/S3Storage.php index 755bd44..5ce30c3 100644 --- a/Classes/S3Storage.php +++ b/Classes/S3Storage.php @@ -303,7 +303,7 @@ public function deleteResource(PersistentResource $resource): bool * @return bool|resource A URI (for example the full path and filename) leading to the resource file or FALSE if it does not exist * @api */ - public function getStreamByResource(PersistentResource $resource): bool + public function getStreamByResource(PersistentResource $resource) { try { return fopen('s3://' . $this->bucketName . '/' . $this->keyPrefix . $resource->getSha1(), 'rb'); @@ -325,7 +325,7 @@ public function getStreamByResource(PersistentResource $resource): bool * @return bool|resource A URI (for example the full path and filename) leading to the resource file or FALSE if it does not exist * @api */ - public function getStreamByResourcePath($relativePath): bool + public function getStreamByResourcePath($relativePath) { try { return fopen('s3://' . $this->bucketName . '/' . $this->keyPrefix . ltrim('/', $relativePath), 'rb');