Skip to content

Commit

Permalink
Make phpcs happier
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Feb 26, 2015
1 parent 7530ff8 commit 2dc47a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions class.phpmailer.php
Expand Up @@ -585,7 +585,8 @@ public function __construct($exceptions = false)
*/
public function __destruct()
{
if ($this->Mailer == 'smtp') { //close any open SMTP connection nicely
//Close any open SMTP connection nicely
if ($this->Mailer == 'smtp') {
$this->smtpClose();
}
}
Expand Down Expand Up @@ -1262,7 +1263,8 @@ protected function smtpSend($header, $body)
$this->smtp->quit();
$this->smtp->close();
}
if (count($bad_rcpt) > 0) { // Create error message for any bad addresses
//Create error message for any bad addresses
if (count($bad_rcpt) > 0) {
throw new phpmailerException(
$this->lang('recipients_failed') . implode(', ', $bad_rcpt),
self::STOP_CONTINUE
Expand Down Expand Up @@ -2339,7 +2341,8 @@ public function encodeHeader($str, $position = 'text')
break;
}

if ($matchcount == 0) { // There are no chars that need encoding
//There are no chars that need encoding
if ($matchcount == 0) {
return ($str);
}

Expand Down
9 changes: 6 additions & 3 deletions class.smtp.php
Expand Up @@ -309,7 +309,8 @@ public function connect($host, $port = null, $timeout = 30, $options = array())
// Windows does not have support for this timeout function
if (substr(PHP_OS, 0, 3) != 'WIN') {
$max = ini_get('max_execution_time');
if ($max != 0 && $timeout > $max) { // Don't bother if unlimited
// Don't bother if unlimited
if ($max != 0 && $timeout > $max) {
@set_time_limit($timeout);
}
stream_set_timeout($this->smtp_conn, $timeout, 0);
Expand Down Expand Up @@ -632,7 +633,8 @@ public function data($msg_data)
//Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on
//so as to avoid breaking in the middle of a word
$pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' ');
if (!$pos) { //Deliberately matches both false and 0
//Deliberately matches both false and 0
if (!$pos) {
//No nice break found, add a hard break
$pos = self::MAX_LINE_LENGTH - 1;
$lines_out[] = substr($line, 0, $pos);
Expand Down Expand Up @@ -838,7 +840,8 @@ protected function sendCommand($command, $commandstring, $expect)
'',
$this->last_reply
);
} else { // Fall back to simple parsing if regex fails
} else {
// Fall back to simple parsing if regex fails
$code = substr($this->last_reply, 0, 3);
$code_ex = null;
$detail = substr($this->last_reply, 4);
Expand Down

0 comments on commit 2dc47a8

Please sign in to comment.