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/Encryption/Util.php | |
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/Encryption/Util.php')
-rw-r--r-- | lib/private/Encryption/Util.php | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/private/Encryption/Util.php b/lib/private/Encryption/Util.php index 937a77bca7a..a5414a66796 100644 --- a/lib/private/Encryption/Util.php +++ b/lib/private/Encryption/Util.php @@ -38,7 +38,6 @@ use OCP\IConfig; use OCP\IUser; class Util { - const HEADER_START = 'HBEGIN'; const HEADER_END = 'HEND'; const HEADER_PADDING_CHAR = '-'; @@ -89,7 +88,6 @@ class Util { \OC\User\Manager $userManager, \OC\Group\Manager $groupManager, IConfig $config) { - $this->ocHeaderKeys = [ self::HEADER_ENCRYPTION_MODULE_KEY ]; @@ -179,7 +177,6 @@ class Util { $result[] = $c->getPath(); } } - } return $result; @@ -226,7 +223,6 @@ class Util { * @throws \BadMethodCallException */ public function getUidAndFilename($path) { - $parts = explode('/', $path); $uid = ''; if (count($parts) > 2) { @@ -241,7 +237,6 @@ class Util { $ownerPath = implode('/', array_slice($parts, 2)); return [$uid, Filesystem::normalizePath($ownerPath)]; - } /** @@ -254,18 +249,16 @@ class Util { $extension = pathinfo($path, PATHINFO_EXTENSION); if ($extension === 'part') { - $newLength = strlen($path) - 5; // 5 = strlen(".part") $fPath = substr($path, 0, $newLength); // if path also contains a transaction id, we remove it too $extension = pathinfo($fPath, PATHINFO_EXTENSION); - if(substr($extension, 0, 12) === 'ocTransferId') { // 12 = strlen("ocTransferId") + if (substr($extension, 0, 12) === 'ocTransferId') { // 12 = strlen("ocTransferId") $newLength = strlen($fPath) - strlen($extension) -1; $fPath = substr($fPath, 0, $newLength); } return $fPath; - } else { return $path; } @@ -372,7 +365,6 @@ class Util { // detect user specific folders if ($this->userManager->userExists($root[1]) && in_array($root[2], $this->excludedPaths)) { - return true; } } @@ -408,5 +400,4 @@ class Util { public function getKeyStorageRoot() { return $this->config->getAppValue('core', 'encryption_key_storage_root', ''); } - } |