@@ -57,7 +57,7 @@ public function __construct()
5757 * Sets the sender of the message. Email or format "John Doe" <[email protected] > 5858 * @return static
5959 */
60- public function setFrom (string $ email , string $ name = null )
60+ public function setFrom (string $ email , ? string $ name = null )
6161 {
6262 $ this ->setHeader ('From ' , $ this ->formatEmail ($ email , $ name ));
6363 return $ this ;
@@ -77,7 +77,7 @@ public function getFrom(): ?array
7777 * Adds the reply-to address. Email or format "John Doe" <[email protected] > 7878 * @return static
7979 */
80- public function addReplyTo (string $ email , string $ name = null )
80+ public function addReplyTo (string $ email , ? string $ name = null )
8181 {
8282 $ this ->setHeader ('Reply-To ' , $ this ->formatEmail ($ email , $ name ), true );
8383 return $ this ;
@@ -108,7 +108,7 @@ public function getSubject(): ?string
108108 * Adds email recipient. Email or format "John Doe" <[email protected] > 109109 * @return static
110110 */
111- public function addTo (string $ email , string $ name = null ) // addRecipient()
111+ public function addTo (string $ email , ? string $ name = null ) // addRecipient()
112112 {
113113 $ this ->setHeader ('To ' , $ this ->formatEmail ($ email , $ name ), true );
114114 return $ this ;
@@ -119,7 +119,7 @@ public function addTo(string $email, string $name = null) // addRecipient()
119119 * Adds carbon copy email recipient. Email or format "John Doe" <[email protected] > 120120 * @return static
121121 */
122- public function addCc (string $ email , string $ name = null )
122+ public function addCc (string $ email , ? string $ name = null )
123123 {
124124 $ this ->setHeader ('Cc ' , $ this ->formatEmail ($ email , $ name ), true );
125125 return $ this ;
@@ -130,7 +130,7 @@ public function addCc(string $email, string $name = null)
130130 * Adds blind carbon copy email recipient. Email or format "John Doe" <[email protected] > 131131 * @return static
132132 */
133- public function addBcc (string $ email , string $ name = null )
133+ public function addBcc (string $ email , ? string $ name = null )
134134 {
135135 $ this ->setHeader ('Bcc ' , $ this ->formatEmail ($ email , $ name ), true );
136136 return $ this ;
@@ -140,7 +140,7 @@ public function addBcc(string $email, string $name = null)
140140 /**
141141 * Formats recipient email.
142142 */
143- private function formatEmail (string $ email , string $ name = null ): array
143+ private function formatEmail (string $ email , ? string $ name = null ): array
144144 {
145145 if (!$ name && preg_match ('#^(.+) +<(.*)>$#D ' , $ email , $ matches )) {
146146 [, $ name , $ email ] = $ matches ;
@@ -200,7 +200,7 @@ public function getPriority(): ?int
200200 * Sets HTML body.
201201 * @return static
202202 */
203- public function setHtmlBody (string $ html , string $ basePath = null )
203+ public function setHtmlBody (string $ html , ? string $ basePath = null )
204204 {
205205 if ($ basePath ) {
206206 $ cids = [];
@@ -259,7 +259,7 @@ public function getHtmlBody(): string
259259 /**
260260 * Adds embedded file.
261261 */
262- public function addEmbeddedFile (string $ file , string $ content = null , string $ contentType = null ): MimePart
262+ public function addEmbeddedFile (string $ file , ? string $ content = null , ? string $ contentType = null ): MimePart
263263 {
264264 return $ this ->inlines [$ file ] = $ this ->createAttachment ($ file , $ content , $ contentType , 'inline ' )
265265 ->setHeader ('Content-ID ' , $ this ->getRandomId ());
@@ -280,7 +280,7 @@ public function addInlinePart(MimePart $part)
280280 /**
281281 * Adds attachment.
282282 */
283- public function addAttachment (string $ file , string $ content = null , string $ contentType = null ): MimePart
283+ public function addAttachment (string $ file , ? string $ content = null , ? string $ contentType = null ): MimePart
284284 {
285285 return $ this ->attachments [] = $ this ->createAttachment ($ file , $ content , $ contentType , 'attachment ' );
286286 }
0 commit comments