aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/ObjectStore/S3Signature.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
commitcaff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch)
tree186d494c2aea5dea7255d3584ef5d595fc6e6194 /lib/private/Files/ObjectStore/S3Signature.php
parentedf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff)
downloadnextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.tar.gz
nextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.zip
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Files/ObjectStore/S3Signature.php')
-rw-r--r--lib/private/Files/ObjectStore/S3Signature.php15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/private/Files/ObjectStore/S3Signature.php b/lib/private/Files/ObjectStore/S3Signature.php
index 6216992ad7a..f9ea2e22aad 100644
--- a/lib/private/Files/ObjectStore/S3Signature.php
+++ b/lib/private/Files/ObjectStore/S3Signature.php
@@ -33,8 +33,7 @@ use Psr\Http\Message\RequestInterface;
/**
* Legacy Amazon S3 signature implementation
*/
-class S3Signature implements SignatureInterface
-{
+class S3Signature implements SignatureInterface {
/** @var array Query string values that must be signed */
private $signableQueryString = [
'acl', 'cors', 'delete', 'lifecycle', 'location', 'logging',
@@ -52,8 +51,7 @@ class S3Signature implements SignatureInterface
/** @var \Aws\S3\S3UriParser S3 URI parser */
private $parser;
- public function __construct()
- {
+ public function __construct() {
$this->parser = new S3UriParser();
// Ensure that the signable query string parameters are sorted
sort($this->signableQueryString);
@@ -140,8 +138,7 @@ class S3Signature implements SignatureInterface
return Psr7\modify_request($request, $modify);
}
- private function signString($string, CredentialsInterface $credentials)
- {
+ private function signString($string, CredentialsInterface $credentials) {
return base64_encode(
hash_hmac('sha1', $string, $credentials->getSecretKey(), true)
);
@@ -166,8 +163,7 @@ class S3Signature implements SignatureInterface
return $buffer;
}
- private function createCanonicalizedAmzHeaders(RequestInterface $request)
- {
+ private function createCanonicalizedAmzHeaders(RequestInterface $request) {
$headers = [];
foreach ($request->getHeaders() as $name => $header) {
$name = strtolower($name);
@@ -188,8 +184,7 @@ class S3Signature implements SignatureInterface
return implode("\n", $headers) . "\n";
}
- private function createCanonicalizedResource(RequestInterface $request)
- {
+ private function createCanonicalizedResource(RequestInterface $request) {
$data = $this->parser->parse($request->getUri());
$buffer = '/';