Fix PHPCS warnings in /includes/mail/
authorSiebrand Mazeland <siebrand@kitano.nl>
Mon, 28 Sep 2015 11:47:16 +0000 (13:47 +0200)
committerSiebrand Mazeland <siebrand@kitano.nl>
Mon, 28 Sep 2015 11:47:16 +0000 (13:47 +0200)
Change-Id: Iea420ddecac86ef9a6f34b420b0cd151ba604e91

includes/mail/EmailNotification.php
includes/mail/UserMailer.php

index 01b6afa..31dd395 100644 (file)
@@ -148,11 +148,10 @@ class EmailNotification {
                $watchers = self::updateWatchlistTimestamp( $editor, $title, $timestamp );
 
                $sendEmail = true;
+               // $watchers deals with $wgEnotifWatchlist.
                // If nobody is watching the page, and there are no users notified on all changes
                // don't bother creating a job/trying to send emails, unless it's a
                // talk page with an applicable notification.
-               //
-               // $watchers deals with $wgEnotifWatchlist
                if ( !count( $watchers ) && !count( $wgUsersNotifiedOnAllChanges ) ) {
                        $sendEmail = false;
                        // Only send notification for non minor edits, unless $wgEnotifMinorEdits
index 7c5f18d..3c28c5f 100644 (file)
@@ -178,32 +178,34 @@ class UserMailer {
                        return Status::newFatal( 'user-mail-no-addy' );
                }
 
-               // Forge email headers
-               // -------------------
-               //
-               // WARNING
-               //
-               // DO NOT add To: or Subject: headers at this step. They need to be
-               // handled differently depending upon the mailer we are going to use.
-               //
-               // To:
-               //  PHP mail() first argument is the mail receiver. The argument is
-               //  used as a recipient destination and as a To header.
-               //
-               //  PEAR mailer has a recipient argument which is only used to
-               //  send the mail. If no To header is given, PEAR will set it to
-               //  to 'undisclosed-recipients:'.
-               //
-               //  NOTE: To: is for presentation, the actual recipient is specified
-               //  by the mailer using the Rcpt-To: header.
-               //
-               // Subject:
-               //  PHP mail() second argument to pass the subject, passing a Subject
-               //  as an additional header will result in a duplicate header.
-               //
-               //  PEAR mailer should be passed a Subject header.
-               //
-               // -- hashar 20120218
+               /**
+                * Forge email headers
+                * -------------------
+                *
+                * WARNING
+                *
+                * DO NOT add To: or Subject: headers at this step. They need to be
+                * handled differently depending upon the mailer we are going to use.
+                *
+                * To:
+                *  PHP mail() first argument is the mail receiver. The argument is
+                *  used as a recipient destination and as a To header.
+                *
+                *  PEAR mailer has a recipient argument which is only used to
+                *  send the mail. If no To header is given, PEAR will set it to
+                *  to 'undisclosed-recipients:'.
+                *
+                *  NOTE: To: is for presentation, the actual recipient is specified
+                *  by the mailer using the Rcpt-To: header.
+                *
+                * Subject:
+                *  PHP mail() second argument to pass the subject, passing a Subject
+                *  as an additional header will result in a duplicate header.
+                *
+                *  PEAR mailer should be passed a Subject header.
+                *
+                * -- hashar 20120218
+                */
 
                $headers['From'] = $from->toString();
                $returnPath = $from->address;
@@ -326,9 +328,7 @@ class UserMailer {
                        MediaWiki\restoreWarnings();
                        return Status::newGood();
                } else {
-                       //
                        // PHP mail()
-                       //
                        if ( count( $to ) > 1 ) {
                                $headers['To'] = 'undisclosed-recipients:;';
                        }