2323 *
2424 * Permits email to be sent using Mail, Sendmail, or SMTP.
2525 *
26- * @see \CodeIgniter\Email\ EmailTest
26+ * @see EmailTest
2727 */
2828class Email
2929{
@@ -1087,10 +1087,8 @@ public function wordWrap($str, $charlim = null)
10871087
10881088 /**
10891089 * Build final headers
1090- *
1091- * @return void
10921090 */
1093- protected function buildHeaders ()
1091+ protected function buildHeaders (): void
10941092 {
10951093 $ this ->setHeader ('User-Agent ' , $ this ->userAgent );
10961094 $ this ->setHeader ('X-Sender ' , $ this ->cleanEmail ($ this ->headers ['From ' ]));
@@ -1102,10 +1100,8 @@ protected function buildHeaders()
11021100
11031101 /**
11041102 * Write Headers as a string
1105- *
1106- * @return void
11071103 */
1108- protected function writeHeaders ()
1104+ protected function writeHeaders (): void
11091105 {
11101106 if ($ this ->protocol === 'mail ' && isset ($ this ->headers ['Subject ' ])) {
11111107 $ this ->subject = $ this ->headers ['Subject ' ];
@@ -1130,10 +1126,8 @@ protected function writeHeaders()
11301126
11311127 /**
11321128 * Build Final Body and attachments
1133- *
1134- * @return void
11351129 */
1136- protected function buildMessage ()
1130+ protected function buildMessage (): void
11371131 {
11381132 if ($ this ->wordWrap === true && $ this ->mailType !== 'html ' ) {
11391133 $ this ->body = $ this ->wordWrap ($ this ->body );
@@ -1294,10 +1288,8 @@ protected function attachmentsHaveMultipart($type)
12941288 * @param string $body Message body to append to
12951289 * @param string $boundary Multipart boundary
12961290 * @param string|null $multipart When provided, only attachments of this type will be processed
1297- *
1298- * @return void
12991291 */
1300- protected function appendAttachments (&$ body , $ boundary , $ multipart = null )
1292+ protected function appendAttachments (&$ body , $ boundary , $ multipart = null ): void
13011293 {
13021294 foreach ($ this ->attachments as $ attachment ) {
13031295 if (isset ($ multipart ) && $ attachment ['multipart ' ] !== $ multipart ) {
@@ -1612,10 +1604,8 @@ public function send($autoClear = true)
16121604
16131605 /**
16141606 * Batch Bcc Send. Sends groups of BCCs in batches
1615- *
1616- * @return void
16171607 */
1618- public function batchBCCSend ()
1608+ public function batchBCCSend (): void
16191609 {
16201610 $ float = $ this ->BCCBatchSize - 1 ;
16211611 $ set = '' ;
@@ -1658,10 +1648,8 @@ public function batchBCCSend()
16581648
16591649 /**
16601650 * Unwrap special elements
1661- *
1662- * @return void
16631651 */
1664- protected function unwrapSpecials ()
1652+ protected function unwrapSpecials (): void
16651653 {
16661654 $ this ->finalBody = preg_replace_callback (
16671655 '/\{unwrap\}(.*?)\{\/unwrap\}/si ' ,
@@ -1874,10 +1862,8 @@ protected function sendWithSmtp()
18741862
18751863 /**
18761864 * Shortcut to send RSET or QUIT depending on keep-alive
1877- *
1878- * @return void
18791865 */
1880- protected function SMTPEnd ()
1866+ protected function SMTPEnd (): void
18811867 {
18821868 $ this ->sendCommand ($ this ->SMTPKeepAlive ? 'reset ' : 'quit ' );
18831869 }
@@ -2022,7 +2008,7 @@ protected function sendCommand($cmd, $data = '')
20222008 */
20232009 protected function SMTPAuthenticate ()
20242010 {
2025- if (!$ this ->SMTPAuth ) {
2011+ if (! $ this ->SMTPAuth ) {
20262012 return true ;
20272013 }
20282014
@@ -2060,12 +2046,13 @@ protected function SMTPAuthenticate()
20602046 $ this ->sendData (base64_encode ($ this ->SMTPPass ));
20612047 $ reply = $ this ->getSMTPData ();
20622048
2063- if (!str_starts_with ($ reply , '235 ' )) {
2049+ if (! str_starts_with ($ reply , '235 ' )) {
20642050 $ this ->setErrorMessage (lang ('Email.SMTPAuthPassword ' , [$ reply ]));
20652051
20662052 return false ;
20672053 }
20682054 break ;
2055+
20692056 case 'PLAIN ' :
20702057 // Generate single command for PLAIN authentication
20712058 $ authString = "\0" . $ this ->SMTPUser . "\0" . $ this ->SMTPPass ;
@@ -2080,6 +2067,7 @@ protected function SMTPAuthenticate()
20802067 }
20812068
20822069 break ;
2070+
20832071 default :
20842072 $ this ->setErrorMessage (lang ('Email.noSMTPAuthMethod ' ));
20852073
@@ -2222,10 +2210,8 @@ private function printDebuggerRaw(): string
22222210
22232211 /**
22242212 * @param string $msg
2225- *
2226- * @return void
22272213 */
2228- protected function setErrorMessage ($ msg )
2214+ protected function setErrorMessage ($ msg ): void
22292215 {
22302216 $ this ->debugMessage [] = $ msg . '<br> ' ;
22312217 $ this ->debugMessageRaw [] = $ msg ;
0 commit comments