Skip to content

Commit

Permalink
Cleaned up contribution
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdejonge committed Jan 15, 2022
1 parent 1435060 commit 189e3a3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/AwsS3V3/AwsS3V3Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,15 @@ private function createOptionsFromConfig(Config $config): array
{
$options = ['params' => []];

foreach (array_merge(static::AVAILABLE_OPTIONS, static::MUP_AVAILABLE_OPTIONS) as $option) {
foreach (static::AVAILABLE_OPTIONS as $option) {
$value = $config->get($option, '__NOT_SET__');

if ($value !== '__NOT_SET__') {
$options['params'][$option] = $value;
}
}

foreach (static::MUP_AVAILABLE_OPTIONS as $option) {
$value = $config->get($option, '__NOT_SET__');

if ($value !== '__NOT_SET__') {
Expand Down Expand Up @@ -427,7 +435,7 @@ public function copy(string $source, string $destination, Config $config): void
$this->bucket,
$this->prefixer->prefixPath($destination),
$this->visibility->visibilityToAcl($visibility),
$this->createOptionsFromConfig($config)
$this->createOptionsFromConfig($config)['params']
);
} catch (Throwable $exception) {
throw UnableToCopyFile::fromLocationTo($source, $destination, $exception);
Expand Down

0 comments on commit 189e3a3

Please sign in to comment.