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 /core/Command/User | |
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 'core/Command/User')
-rw-r--r-- | core/Command/User/Add.php | 4 | ||||
-rw-r--r-- | core/Command/User/LastSeen.php | 4 | ||||
-rw-r--r-- | core/Command/User/Report.php | 4 | ||||
-rw-r--r-- | core/Command/User/Setting.php | 2 |
4 files changed, 6 insertions, 8 deletions
diff --git a/core/Command/User/Add.php b/core/Command/User/Add.php index 208fb1dceb5..2fe4de83f60 100644 --- a/core/Command/User/Add.php +++ b/core/Command/User/Add.php @@ -154,11 +154,11 @@ class Add extends Command { if (!$group) { $this->groupManager->createGroup($groupName); $group = $this->groupManager->get($groupName); - if($group instanceof IGroup) { + if ($group instanceof IGroup) { $output->writeln('Created group "' . $group->getGID() . '"'); } } - if($group instanceof IGroup) { + if ($group instanceof IGroup) { $group->addUser($user); $output->writeln('User "' . $user->getUID() . '" added to group "' . $group->getGID() . '"'); } diff --git a/core/Command/User/LastSeen.php b/core/Command/User/LastSeen.php index 37cad457015..5a1e5f3b4e5 100644 --- a/core/Command/User/LastSeen.php +++ b/core/Command/User/LastSeen.php @@ -57,13 +57,13 @@ class LastSeen extends Command { protected function execute(InputInterface $input, OutputInterface $output) { $user = $this->userManager->get($input->getArgument('uid')); - if(is_null($user)) { + if (is_null($user)) { $output->writeln('<error>User does not exist</error>'); return; } $lastLogin = $user->getLastLogin(); - if($lastLogin === 0) { + if ($lastLogin === 0) { $output->writeln('User ' . $user->getUID() . ' has never logged in, yet.'); } else { diff --git a/core/Command/User/Report.php b/core/Command/User/Report.php index 7f4562fc426..fff3924d324 100644 --- a/core/Command/User/Report.php +++ b/core/Command/User/Report.php @@ -55,10 +55,10 @@ class Report extends Command { $table = new Table($output); $table->setHeaders(['User Report', '']); $userCountArray = $this->countUsers(); - if(!empty($userCountArray)) { + if (!empty($userCountArray)) { $total = 0; $rows = []; - foreach($userCountArray as $classname => $users) { + foreach ($userCountArray as $classname => $users) { $total += $users; $rows[] = [$classname, $users]; } diff --git a/core/Command/User/Setting.php b/core/Command/User/Setting.php index e084b94cc8a..71509d4eb6e 100644 --- a/core/Command/User/Setting.php +++ b/core/Command/User/Setting.php @@ -187,7 +187,6 @@ class Setting extends Base { $this->config->setUserValue($uid, $app, $key, $input->getArgument('value')); return 0; - } elseif ($input->hasParameterOption('--delete')) { if ($input->hasParameterOption('--error-if-not-exists') && $value === null) { $output->writeln('<error>The setting does not exist for user "' . $uid . '".</error>'); @@ -204,7 +203,6 @@ class Setting extends Base { $this->config->deleteUserValue($uid, $app, $key); return 0; - } elseif ($value !== null) { $output->writeln($value); return 0; |