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/Mail | |
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/Mail')
-rw-r--r-- | lib/private/Mail/Attachment.php | 1 | ||||
-rw-r--r-- | lib/private/Mail/EMailTemplate.php | 6 | ||||
-rw-r--r-- | lib/private/Mail/Mailer.php | 4 | ||||
-rw-r--r-- | lib/private/Mail/Message.php | 4 |
4 files changed, 6 insertions, 9 deletions
diff --git a/lib/private/Mail/Attachment.php b/lib/private/Mail/Attachment.php index 3f80b065d5a..1f88c875565 100644 --- a/lib/private/Mail/Attachment.php +++ b/lib/private/Mail/Attachment.php @@ -80,5 +80,4 @@ class Attachment implements IAttachment { public function getSwiftAttachment(): \Swift_Mime_Attachment { return $this->swiftAttachment; } - } diff --git a/lib/private/Mail/EMailTemplate.php b/lib/private/Mail/EMailTemplate.php index c3da61c707b..9e2f099259c 100644 --- a/lib/private/Mail/EMailTemplate.php +++ b/lib/private/Mail/EMailTemplate.php @@ -191,7 +191,7 @@ EOF; </table> EOF; - // note: listBegin (like bodyBegin) is not processed through sprintf, so "%" is not escaped as "%%". (bug #12151) + // note: listBegin (like bodyBegin) is not processed through sprintf, so "%" is not escaped as "%%". (bug #12151) protected $listBegin = <<<EOF <table class="row description" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%"> <tbody> @@ -550,7 +550,6 @@ EOF; $this->htmlBody .= vsprintf($this->buttonGroup, [$color, $color, $urlLeft, $color, $textColor, $textColor, $textLeft, $urlRight, $textRight]); $this->plainBody .= $plainTextLeft . ': ' . $urlLeft . PHP_EOL; $this->plainBody .= $plainTextRight . ': ' . $urlRight . PHP_EOL . PHP_EOL; - } /** @@ -585,7 +584,6 @@ EOF; } $this->plainBody .= $url . PHP_EOL; - } /** @@ -608,7 +606,7 @@ EOF; * @param string $text If the text is empty the default "Name - Slogan<br>This is an automatically sent email" will be used */ public function addFooter(string $text = '') { - if($text === '') { + if ($text === '') { $text = $this->themingDefaults->getName() . ' - ' . $this->themingDefaults->getSlogan() . '<br>' . $this->l10n->t('This is an automatically sent email, please do not reply.'); } diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php index c07556b6a62..57778e263d7 100644 --- a/lib/private/Mail/Mailer.php +++ b/lib/private/Mail/Mailer.php @@ -186,7 +186,7 @@ class Mailer implements IMailer { $mailer = $this->getInstance(); // Enable logger if debug mode is enabled - if($debugMode) { + if ($debugMode) { $mailLogger = new \Swift_Plugins_Loggers_ArrayLogger(); $mailer->registerPlugin(new \Swift_Plugins_LoggerPlugin($mailLogger)); } @@ -199,7 +199,7 @@ class Mailer implements IMailer { // Debugging logging $logMessage = sprintf('Sent mail to "%s" with subject "%s"', print_r($message->getTo(), true), $message->getSubject()); $this->logger->debug($logMessage, ['app' => 'core']); - if($debugMode && isset($mailLogger)) { + if ($debugMode && isset($mailLogger)) { $this->logger->debug($mailLogger->dump(), ['app' => 'core']); } diff --git a/lib/private/Mail/Message.php b/lib/private/Mail/Message.php index e5a31b5cbe1..c8c48518d52 100644 --- a/lib/private/Mail/Message.php +++ b/lib/private/Mail/Message.php @@ -77,8 +77,8 @@ class Message implements IMessage { $convertedAddresses = []; - foreach($addresses as $email => $readableName) { - if(!is_numeric($email)) { + foreach ($addresses as $email => $readableName) { + if (!is_numeric($email)) { list($name, $domain) = explode('@', $email, 2); $domain = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46); $convertedAddresses[$name.'@'.$domain] = $readableName; |