Skip to content

Commit

Permalink
Merge branch '3.x' into replace-ternary-with-null-coalescing
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdejonge authored Nov 6, 2023
2 parents a0ea95e + 309da4c commit 03be643
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions AwsS3V3Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,11 @@ public function move(string $source, string $destination, Config $config): void
public function copy(string $source, string $destination, Config $config): void
{
try {
/** @var string $visibility */
$visibility = $config->get(Config::OPTION_VISIBILITY) ?? $this->visibility($source)->visibility();
$visibility = $config->get(Config::OPTION_VISIBILITY);

if ($visibility === null && $config->get('retain_visibility', true)) {
$visibility = $this->visibility($source)->visibility();
}
} catch (Throwable $exception) {
throw UnableToCopyFile::fromLocationTo(
$source,
Expand All @@ -431,7 +434,7 @@ public function copy(string $source, string $destination, Config $config): void
$this->prefixer->prefixPath($source),
$this->bucket,
$this->prefixer->prefixPath($destination),
$this->visibility->visibilityToAcl($visibility),
$this->visibility->visibilityToAcl($visibility ?: 'private'),
$this->createOptionsFromConfig($config)['params']
);
} catch (Throwable $exception) {
Expand Down

0 comments on commit 03be643

Please sign in to comment.