Преглед изворни кода

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 пре 11 година
родитељ
комит
42ea303cfe
1 измењених фајлова са 3 додато и 1 уклоњено
  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
      * Add headers to the message
      *
      *
      * @param  string|array $headers Custom added headers
      * @param  string|array $headers Custom added headers
-     * @return null
+     * @return self
      */
      */
     public function addHeader($headers)
     public function addHeader($headers)
     {
     {
@@ -88,6 +88,8 @@ class NativeMailerHandler extends MailHandler
             }
             }
             $this->headers[] = $header;
             $this->headers[] = $header;
         }
         }
+
+        return $this;
     }
     }
 
 
     /**
     /**