diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 14:19:56 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 14:19:56 +0200 |
commit | caff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch) | |
tree | 186d494c2aea5dea7255d3584ef5d595fc6e6194 /lib/private/Files/ObjectStore | |
parent | edf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff) | |
download | nextcloud-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')
4 files changed, 6 insertions, 14 deletions
diff --git a/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php b/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php index 98b99efcb5a..efe3f7c12d0 100644 --- a/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php @@ -65,6 +65,4 @@ class HomeObjectStoreStorage extends ObjectStoreStorage implements \OCP\Files\IH public function getUser($path = null) { return $this->user; } - - } diff --git a/lib/private/Files/ObjectStore/NoopScanner.php b/lib/private/Files/ObjectStore/NoopScanner.php index 7a253c82c5b..57a94aba294 100644 --- a/lib/private/Files/ObjectStore/NoopScanner.php +++ b/lib/private/Files/ObjectStore/NoopScanner.php @@ -31,7 +31,6 @@ use OC\Files\Cache\Scanner; use OC\Files\Storage\Storage; class NoopScanner extends Scanner { - public function __construct(Storage $storage) { //we don't need the storage, so do nothing here } diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 7224f075d82..1faa44ad888 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -182,7 +182,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { return false; } } else { - if(!$this->unlink($child['path'])) { + if (!$this->unlink($child['path'])) { return false; } } 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 = '/'; |