summaryrefslogtreecommitdiffstats
path: root/core/Command/Encryption
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 /core/Command/Encryption
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 'core/Command/Encryption')
-rw-r--r--core/Command/Encryption/ChangeKeyStorageRoot.php10
-rw-r--r--core/Command/Encryption/DecryptAll.php1
-rw-r--r--core/Command/Encryption/EncryptAll.php1
-rw-r--r--core/Command/Encryption/ShowKeyStorageRoot.php3
4 files changed, 3 insertions, 12 deletions
diff --git a/core/Command/Encryption/ChangeKeyStorageRoot.php b/core/Command/Encryption/ChangeKeyStorageRoot.php
index 05626715781..bdc2857dd18 100644
--- a/core/Command/Encryption/ChangeKeyStorageRoot.php
+++ b/core/Command/Encryption/ChangeKeyStorageRoot.php
@@ -116,7 +116,6 @@ class ChangeKeyStorageRoot extends Command {
* @throws \Exception
*/
protected function moveAllKeys($oldRoot, $newRoot, OutputInterface $output) {
-
$output->writeln("Start to move keys:");
if ($this->rootView->is_dir($oldRoot) === false) {
@@ -150,7 +149,6 @@ class ChangeKeyStorageRoot extends Command {
if (!$result) {
throw new \Exception("Can't access the new root folder. Please check the permissions and make sure that the folder is in your data folder");
}
-
}
@@ -189,12 +187,11 @@ class ChangeKeyStorageRoot extends Command {
* @param OutputInterface $output
*/
protected function moveUserKeys($oldRoot, $newRoot, OutputInterface $output) {
-
$progress = new ProgressBar($output);
$progress->start();
- foreach($this->userManager->getBackends() as $backend) {
+ foreach ($this->userManager->getBackends() as $backend) {
$limit = 500;
$offset = 0;
do {
@@ -205,7 +202,7 @@ class ChangeKeyStorageRoot extends Command {
$this->moveUserEncryptionFolder($user, $oldRoot, $newRoot);
}
$offset += $limit;
- } while(count($users) >= $limit);
+ } while (count($users) >= $limit);
}
$progress->finish();
}
@@ -219,9 +216,7 @@ class ChangeKeyStorageRoot extends Command {
* @throws \Exception
*/
protected function moveUserEncryptionFolder($user, $oldRoot, $newRoot) {
-
if ($this->userManager->userExists($user)) {
-
$source = $oldRoot . '/' . $user . '/files_encryption';
$target = $newRoot . '/' . $user . '/files_encryption';
if (
@@ -268,5 +263,4 @@ class ChangeKeyStorageRoot extends Command {
return false;
}
-
}
diff --git a/core/Command/Encryption/DecryptAll.php b/core/Command/Encryption/DecryptAll.php
index af1aa4c792c..e631f97cdaa 100644
--- a/core/Command/Encryption/DecryptAll.php
+++ b/core/Command/Encryption/DecryptAll.php
@@ -192,6 +192,5 @@ class DecryptAll extends Command {
$this->resetMaintenanceAndTrashbin();
throw $e;
}
-
}
}
diff --git a/core/Command/Encryption/EncryptAll.php b/core/Command/Encryption/EncryptAll.php
index 77c2cb31204..7c6cad41a37 100644
--- a/core/Command/Encryption/EncryptAll.php
+++ b/core/Command/Encryption/EncryptAll.php
@@ -142,5 +142,4 @@ class EncryptAll extends Command {
$output->writeln('aborted');
}
}
-
}
diff --git a/core/Command/Encryption/ShowKeyStorageRoot.php b/core/Command/Encryption/ShowKeyStorageRoot.php
index a1ab9c2915c..c877d1fcdd3 100644
--- a/core/Command/Encryption/ShowKeyStorageRoot.php
+++ b/core/Command/Encryption/ShowKeyStorageRoot.php
@@ -27,7 +27,7 @@ use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-class ShowKeyStorageRoot extends Command{
+class ShowKeyStorageRoot extends Command {
/** @var Util */
protected $util;
@@ -54,5 +54,4 @@ class ShowKeyStorageRoot extends Command{
$output->writeln("Current key storage root: <info>$rootDescription</info>");
}
-
}