Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
schneidermr committed Nov 23, 2023
1 parent 5af2bd0 commit 73f6344
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Storage/Device/S3.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ class S3 extends Device
* @var array
*/
protected array $headers = [
'host' => '', 'date' => '',
'host' => '',
'date' => '',
'content-md5' => '',
'content-type' => '',
];
Expand Down Expand Up @@ -158,12 +159,12 @@ public function __construct(string $root, string $accessKey, string $secretKey,
$this->acl = $acl;
$this->amzHeaders = [];

if (!empty($endpointUrl)) {
if (! empty($endpointUrl)) {
$host = $bucket.'.'.$endpointUrl;
} else {
$host = match ($region) {
self::CN_NORTH_1, self::CN_NORTH_4, self::CN_NORTHWEST_1 => $bucket.'.s3.'.$region.'.amazonaws.cn',
default => $bucket.'.s3.'.$region.'.amazonaws.com'
self::CN_NORTH_1, self::CN_NORTH_4, self::CN_NORTHWEST_1 => $bucket.'.s3.'.$region.'.amazonaws.cn',
default => $bucket.'.s3.'.$region.'.amazonaws.com'
};
}

Expand Down Expand Up @@ -769,8 +770,10 @@ private function getSignatureV4(string $method, string $uri, array $parameters =

// stringToSign
$stringToSignStr = \implode("\n", [
$algorithm, $this->amzHeaders['x-amz-date'],
\implode('/', $credentialScope), \hash('sha256', $amzPayloadStr),
$algorithm,
$this->amzHeaders['x-amz-date'],
\implode('/', $credentialScope),
\hash('sha256', $amzPayloadStr),
]);

// Make Signature
Expand Down

0 comments on commit 73f6344

Please sign in to comment.