From 94e4fce2dff12a2b581fb86b9ffcabc6de4cdf9d Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Wed, 24 Aug 2022 12:57:00 +0200 Subject: [PATCH] Fix: prevent warning when not set. --- syncer/Filesystems/StorageFilesystem.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syncer/Filesystems/StorageFilesystem.php b/syncer/Filesystems/StorageFilesystem.php index 1922ac5..1b646a3 100644 --- a/syncer/Filesystems/StorageFilesystem.php +++ b/syncer/Filesystems/StorageFilesystem.php @@ -12,8 +12,8 @@ class StorageFilesystem extends Filesystem { $environment = array_merge($_ENV, $_SERVER); $s3Adapter = new AwsS3V3Adapter( - new S3Client([ - 'endpoint' => $environment['S3_ENDPOINT'], + new S3Client(array_filter([ + 'endpoint' => $environment['S3_ENDPOINT'] ?? null, 'use_path_style_endpoint' => isset($environment['S3_USE_PATH_STYLE_ENDPOINT']), 'credentials' => [ 'key' => $environment['S3_API_KEY'], @@ -21,7 +21,7 @@ class StorageFilesystem extends Filesystem ], 'region' => $environment['S3_REGION'] ?? 'us-east', 'version' => 'latest', - ]), + ])), $environment['S3_BUCKET'], $environment['S3_PREFIX'] ?? null );