Skip to content

Commit

Permalink
Some code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kdambekalns committed Feb 3, 2022
1 parent 28ab781 commit b88cdbe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions Classes/Command/S3CommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public function listBucketsCommand(): void
} catch (\Exception $e) {
$this->outputLine($e->getMessage());
$this->quit(1);
exit;
}

if (count($result['Buckets']) === 0) {
Expand Down Expand Up @@ -144,7 +143,6 @@ public function flushBucketCommand(string $bucket): void
} catch (\Exception $e) {
$this->outputLine($e->getMessage());
$this->quit(1);
exit;
}
$promise->wait();
$this->outputLine('Successfully flushed bucket %s.', [$bucket]);
Expand Down
4 changes: 2 additions & 2 deletions Classes/S3Target.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function getKeyPrefix(): string
*/
public function getAcl()
{
return isset($this->acl) ? $this->acl : $this->defaultAcl;
return $this->acl ?? $this->defaultAcl;
}

/**
Expand Down Expand Up @@ -514,7 +514,7 @@ protected function publishFile($sourceStream, string $relativeTargetPathAndFilen
];

try {
$this->s3Client->upload($this->bucketName, $objectName, $sourceStream, $this->getAcl() ? $this->getAcl() : null, $options);
$this->s3Client->upload($this->bucketName, $objectName, $sourceStream, $this->getAcl() ?: null, $options);
$this->systemLogger->debug(sprintf('Successfully published resource as object "%s" in bucket "%s" with SHA1 hash "%s"', $objectName, $this->bucketName, $metaData->getSha1() ?: 'unknown'));
} catch (\Exception $e) {
$this->systemLogger->debug(sprintf('Failed publishing resource as object "%s" in bucket "%s" with SHA1 hash "%s": %s', $objectName, $this->bucketName, $metaData->getSha1() ?: 'unknown', $e->getMessage()));
Expand Down

0 comments on commit b88cdbe

Please sign in to comment.