Procházet zdrojové kódy

Return self from NativeMailerHandler::addHeader().

NativeMailerHandler::setContentType() and NativeMailerHandler::setEncoding()
both return the NativeMailerHandler object, allowing a fluent coding
style.  This fix adds the same behaviour to NativeMailerHandler::addHeader()
for so that all public non-inherited methods behave this way for
consistency.
Liam O'Boyle před 11 roky
rodič
revize
42ea303cfe
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      src/Monolog/Handler/NativeMailerHandler.php

+ 3 - 1
src/Monolog/Handler/NativeMailerHandler.php

@@ -78,7 +78,7 @@ class NativeMailerHandler extends MailHandler
      * Add headers to the message
      *
      * @param  string|array $headers Custom added headers
-     * @return null
+     * @return self
      */
     public function addHeader($headers)
     {
@@ -88,6 +88,8 @@ class NativeMailerHandler extends MailHandler
             }
             $this->headers[] = $header;
         }
+
+        return $this;
     }
 
     /**