Skip to content

Commit

Permalink
Fix return type in S3Storage
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kdambekalns committed Nov 16, 2022
1 parent 36ab1c6 commit c270618
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/S3Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
Expand Down

0 comments on commit c270618

Please sign in to comment.