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/Integrity | |
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/Integrity')
-rw-r--r-- | core/Command/Integrity/CheckApp.php | 3 | ||||
-rw-r--r-- | core/Command/Integrity/CheckCore.php | 2 | ||||
-rw-r--r-- | core/Command/Integrity/SignApp.php | 8 | ||||
-rw-r--r-- | core/Command/Integrity/SignCore.php | 8 |
4 files changed, 10 insertions, 11 deletions
diff --git a/core/Command/Integrity/CheckApp.php b/core/Command/Integrity/CheckApp.php index d62c13deffb..affe137c67d 100644 --- a/core/Command/Integrity/CheckApp.php +++ b/core/Command/Integrity/CheckApp.php @@ -70,9 +70,8 @@ class CheckApp extends Base { $path = (string)$input->getOption('path'); $result = $this->checker->verifyAppSignature($appid, $path); $this->writeArrayInOutputFormat($input, $output, $result); - if (count($result)>0){ + if (count($result)>0) { return 1; } } - } diff --git a/core/Command/Integrity/CheckCore.php b/core/Command/Integrity/CheckCore.php index bebfbea560e..665e0079b44 100644 --- a/core/Command/Integrity/CheckCore.php +++ b/core/Command/Integrity/CheckCore.php @@ -61,7 +61,7 @@ class CheckCore extends Base { protected function execute(InputInterface $input, OutputInterface $output) { $result = $this->checker->verifyCoreSignature(); $this->writeArrayInOutputFormat($input, $output, $result); - if (count($result)>0){ + if (count($result)>0) { return 1; } } diff --git a/core/Command/Integrity/SignApp.php b/core/Command/Integrity/SignApp.php index 6e750d4af10..7657c2975af 100644 --- a/core/Command/Integrity/SignApp.php +++ b/core/Command/Integrity/SignApp.php @@ -76,7 +76,7 @@ class SignApp extends Command { $path = $input->getOption('path'); $privateKeyPath = $input->getOption('privateKey'); $keyBundlePath = $input->getOption('certificate'); - if(is_null($path) || is_null($privateKeyPath) || is_null($keyBundlePath)) { + if (is_null($path) || is_null($privateKeyPath) || is_null($keyBundlePath)) { $documentationUrl = $this->urlGenerator->linkToDocs('developer-code-integrity'); $output->writeln('This command requires the --path, --privateKey and --certificate.'); $output->writeln('Example: ./occ integrity:sign-app --path="/Users/lukasreschke/Programming/myapp/" --privateKey="/Users/lukasreschke/private/myapp.key" --certificate="/Users/lukasreschke/public/mycert.crt"'); @@ -87,12 +87,12 @@ class SignApp extends Command { $privateKey = $this->fileAccessHelper->file_get_contents($privateKeyPath); $keyBundle = $this->fileAccessHelper->file_get_contents($keyBundlePath); - if($privateKey === false) { + if ($privateKey === false) { $output->writeln(sprintf('Private key "%s" does not exists.', $privateKeyPath)); return null; } - if($keyBundle === false) { + if ($keyBundle === false) { $output->writeln(sprintf('Certificate "%s" does not exists.', $keyBundlePath)); return null; } @@ -105,7 +105,7 @@ class SignApp extends Command { try { $this->checker->writeAppSignature($path, $x509, $rsa); $output->writeln('Successfully signed "'.$path.'"'); - } catch (\Exception $e){ + } catch (\Exception $e) { $output->writeln('Error: ' . $e->getMessage()); return 1; } diff --git a/core/Command/Integrity/SignCore.php b/core/Command/Integrity/SignCore.php index b825a942d80..7f871b08298 100644 --- a/core/Command/Integrity/SignCore.php +++ b/core/Command/Integrity/SignCore.php @@ -70,7 +70,7 @@ class SignCore extends Command { $privateKeyPath = $input->getOption('privateKey'); $keyBundlePath = $input->getOption('certificate'); $path = $input->getOption('path'); - if(is_null($privateKeyPath) || is_null($keyBundlePath) || is_null($path)) { + if (is_null($privateKeyPath) || is_null($keyBundlePath) || is_null($path)) { $output->writeln('--privateKey, --certificate and --path are required.'); return null; } @@ -78,12 +78,12 @@ class SignCore extends Command { $privateKey = $this->fileAccessHelper->file_get_contents($privateKeyPath); $keyBundle = $this->fileAccessHelper->file_get_contents($keyBundlePath); - if($privateKey === false) { + if ($privateKey === false) { $output->writeln(sprintf('Private key "%s" does not exists.', $privateKeyPath)); return null; } - if($keyBundle === false) { + if ($keyBundle === false) { $output->writeln(sprintf('Certificate "%s" does not exists.', $keyBundlePath)); return null; } @@ -97,7 +97,7 @@ class SignCore extends Command { try { $this->checker->writeCoreSignature($x509, $rsa, $path); $output->writeln('Successfully signed "core"'); - } catch (\Exception $e){ + } catch (\Exception $e) { $output->writeln('Error: ' . $e->getMessage()); return 1; } |