@@ -55,7 +55,7 @@ public function __construct()
5555 * Sets the sender of the message. Email or format "John Doe" <[email protected] > 5656 * @return static
5757 */
58- public function setFrom (string $ email , string $ name = NULL )
58+ public function setFrom (string $ email , string $ name = null )
5959 {
6060 $ this ->setHeader ('From ' , $ this ->formatEmail ($ email , $ name ));
6161 return $ this ;
@@ -75,9 +75,9 @@ public function getFrom(): array
7575 * Adds the reply-to address. Email or format "John Doe" <[email protected] > 7676 * @return static
7777 */
78- public function addReplyTo (string $ email , string $ name = NULL )
78+ public function addReplyTo (string $ email , string $ name = null )
7979 {
80- $ this ->setHeader ('Reply-To ' , $ this ->formatEmail ($ email , $ name ), TRUE );
80+ $ this ->setHeader ('Reply-To ' , $ this ->formatEmail ($ email , $ name ), true );
8181 return $ this ;
8282 }
8383
@@ -106,9 +106,9 @@ public function getSubject(): ?string
106106 * Adds email recipient. Email or format "John Doe" <[email protected] > 107107 * @return static
108108 */
109- public function addTo (string $ email , string $ name = NULL ) // addRecipient()
109+ public function addTo (string $ email , string $ name = null ) // addRecipient()
110110 {
111- $ this ->setHeader ('To ' , $ this ->formatEmail ($ email , $ name ), TRUE );
111+ $ this ->setHeader ('To ' , $ this ->formatEmail ($ email , $ name ), true );
112112 return $ this ;
113113 }
114114
@@ -117,9 +117,9 @@ public function addTo(string $email, string $name = NULL) // addRecipient()
117117 * Adds carbon copy email recipient. Email or format "John Doe" <[email protected] > 118118 * @return static
119119 */
120- public function addCc (string $ email , string $ name = NULL )
120+ public function addCc (string $ email , string $ name = null )
121121 {
122- $ this ->setHeader ('Cc ' , $ this ->formatEmail ($ email , $ name ), TRUE );
122+ $ this ->setHeader ('Cc ' , $ this ->formatEmail ($ email , $ name ), true );
123123 return $ this ;
124124 }
125125
@@ -128,17 +128,17 @@ public function addCc(string $email, string $name = NULL)
128128 * Adds blind carbon copy email recipient. Email or format "John Doe" <[email protected] > 129129 * @return static
130130 */
131- public function addBcc (string $ email , string $ name = NULL )
131+ public function addBcc (string $ email , string $ name = null )
132132 {
133- $ this ->setHeader ('Bcc ' , $ this ->formatEmail ($ email , $ name ), TRUE );
133+ $ this ->setHeader ('Bcc ' , $ this ->formatEmail ($ email , $ name ), true );
134134 return $ this ;
135135 }
136136
137137
138138 /**
139139 * Formats recipient email.
140140 */
141- private function formatEmail (string $ email , string $ name = NULL ): array
141+ private function formatEmail (string $ email , string $ name = null ): array
142142 {
143143 if (!$ name && preg_match ('#^(.+) +<(.*)>\z# ' , $ email , $ matches )) {
144144 return [$ matches [2 ] => $ matches [1 ]];
@@ -192,7 +192,7 @@ public function getPriority(): int
192192 * Sets HTML body.
193193 * @return static
194194 */
195- public function setHtmlBody (string $ html , string $ basePath = NULL )
195+ public function setHtmlBody (string $ html , string $ basePath = null )
196196 {
197197 if ($ basePath ) {
198198 $ cids = [];
@@ -220,7 +220,7 @@ public function setHtmlBody(string $html, string $basePath = NULL)
220220 }
221221 }
222222
223- if ($ this ->getSubject () == NULL ) { // intentionally ==
223+ if ($ this ->getSubject () == null ) { // intentionally ==
224224 $ html = Strings::replace ($ html , '#<title>(.+?)</title>#is ' , function ($ m ) {
225225 $ this ->setSubject (html_entity_decode ($ m [1 ], ENT_QUOTES , 'UTF-8 ' ));
226226 });
@@ -248,7 +248,7 @@ public function getHtmlBody(): string
248248 /**
249249 * Adds embedded file.
250250 */
251- public function addEmbeddedFile (string $ file , string $ content = NULL , string $ contentType = NULL ): MimePart
251+ public function addEmbeddedFile (string $ file , string $ content = null , string $ contentType = null ): MimePart
252252 {
253253 return $ this ->inlines [$ file ] = $ this ->createAttachment ($ file , $ content , $ contentType , 'inline ' )
254254 ->setHeader ('Content-ID ' , $ this ->getRandomId ());
@@ -269,7 +269,7 @@ public function addInlinePart(MimePart $part)
269269 /**
270270 * Adds attachment.
271271 */
272- public function addAttachment (string $ file , string $ content = NULL , string $ contentType = NULL ): MimePart
272+ public function addAttachment (string $ file , string $ content = null , string $ contentType = null ): MimePart
273273 {
274274 return $ this ->attachments [] = $ this ->createAttachment ($ file , $ content , $ contentType , 'attachment ' );
275275 }
@@ -288,12 +288,12 @@ public function getAttachments(): array
288288 /**
289289 * Creates file MIME part.
290290 */
291- private function createAttachment (string $ file , string $ content = NULL , string $ contentType = NULL , string $ disposition ): MimePart
291+ private function createAttachment (string $ file , string $ content = null , string $ contentType = null , string $ disposition ): MimePart
292292 {
293293 $ part = new MimePart ;
294- if ($ content === NULL ) {
294+ if ($ content === null ) {
295295 $ content = @file_get_contents ($ file ); // @ is escalated to exception
296- if ($ content === FALSE ) {
296+ if ($ content === false ) {
297297 throw new Nette \FileNotFoundException ("Unable to read file ' $ file'. " );
298298 }
299299 }
0 commit comments