Skip to content

Commit

Permalink
Code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Sep 8, 2017
1 parent efd7561 commit 700ea09
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 28 deletions.
42 changes: 24 additions & 18 deletions src/PHPMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,17 @@ class PHPMailer
* * `error_log` Output to error log as configured in php.ini
* By default PHPMailer will use `echo` if run from a `cli` or `cli-server` SAPI, `html` otherwise.
* Alternatively, you can provide a callable expecting two params: a message string and the debug level:
* <code>
*
* ```php
* $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
* </code>
* ```
*
* Alternatively, you can pass in an instance of a PSR-3 compatible logger, though only `debug`
* level output is used:
* <code>
*
* ```php
* $mail->Debugoutput = new myPsr3Logger;
* </code>
* ```
*
* @see SMTP::$Debugoutput
*
Expand Down Expand Up @@ -434,7 +437,7 @@ class PHPMailer
*
* @example 'example.com'
*
* @var string
* @var string
*/
public $DKIM_domain = '';

Expand Down Expand Up @@ -737,11 +740,11 @@ public function __destruct()
* claims to be sendmail), don't pass params (not a perfect fix,
* but it will do).
*
* @param string $to To
* @param string $subject Subject
* @param string $body Message Body
* @param string $header Additional Header(s)
* @param ?string $params Params
* @param string $to To
* @param string $subject Subject
* @param string $body Message Body
* @param string $header Additional Header(s)
* @param string|null $params Params
*
* @return bool
*/
Expand Down Expand Up @@ -1161,11 +1164,13 @@ public function getLastMessageID()
* * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
* * `noregex` Don't use a regex: super fast, really dumb.
* Alternatively you may pass in a callable to inject your own validator, for example:
* <code>
*
* ```php
* PHPMailer::validateAddress('[email protected]', function($address) {
* return (strpos($address, '@') !== false);
* });
* </code>
* ```
*
* You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator.
*
* @param string $address The email address to check
Expand Down Expand Up @@ -3599,8 +3604,8 @@ public function isError()
* $name value can be overloaded to contain
* both header name and value (name:value).
*
* @param string $name Custom header name
* @param ?string $value Header value
* @param string $name Custom header name
* @param string|null $value Header value
*/
public function addCustomHeader($name, $value = null)
{
Expand Down Expand Up @@ -3636,7 +3641,7 @@ public function getCustomHeaders()
* @param string $message HTML message string
* @param string $basedir Absolute path to a base directory to prepend to relative paths to images
* @param bool|callable $advanced Whether to use the internal HTML to text converter
* or your own custom converter @see PHPMailer::html2text().
* or your own custom converter @see PHPMailer::html2text()
*
* @return string $message The transformed message Body
*/
Expand Down Expand Up @@ -3730,19 +3735,20 @@ public function msgHTML($message, $basedir = '', $advanced = false)
* Note - older versions of this function used a bundled advanced converter
* which was removed for license reasons in #232.
* Example usage:
* <code>
*
* ```php
* // Use default conversion
* $plain = $mail->html2text($html);
* // Use your own custom converter
* $plain = $mail->html2text($html, function($html) {
* $converter = new MyHtml2text($html);
* return $converter->get_text();
* });
* </code>
* ```
*
* @param string $html The HTML text to convert
* @param bool|callable $advanced Any boolean value to use the internal converter,
* or provide your own callable for custom conversion.
* or provide your own callable for custom conversion
*
* @return string
*/
Expand Down
2 changes: 1 addition & 1 deletion src/POP3.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class POP3
/**
* Simple static wrapper for all-in-one POP before SMTP.
*
* @param string $host
* @param string $host The hostname to connect to
* @param int|bool $port The port number to connect to
* @param int|bool $timeout The timeout value
* @param string $username
Expand Down
22 changes: 15 additions & 7 deletions src/SMTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* PHP Version 5.5.
*
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <[email protected]>
* @author Jim Jagielski (jimjag) <[email protected]>
* @author Andy Prevost (codeworxtech) <[email protected]>
Expand Down Expand Up @@ -101,14 +102,17 @@ class SMTP
* * `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output
* * `error_log` Output to error log as configured in php.ini
* Alternatively, you can provide a callable expecting two params: a message string and the debug level:
* <code>
*
* ```php
* $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
* </code>
* ```
*
* Alternatively, you can pass in an instance of a PSR-3 compatible logger, though only `debug`
* level output is used:
* <code>
*
* ```php
* $mail->Debugoutput = new myPsr3Logger;
* </code>
* ```
*
* @var string|callable|\Psr\Log\LoggerInterface
*/
Expand Down Expand Up @@ -144,9 +148,11 @@ class SMTP
public $Timelimit = 300;

/**
* @var array Patterns to extract an SMTP transaction id from reply to a DATA command.
* Patterns to extract an SMTP transaction id from reply to a DATA command.
* The first capture group in each regex will be used as the ID.
* MS ESMTP returns the message ID, which may not be correct for internal tracking.
*
* @var string[]
*/
protected $smtp_transaction_id_patterns = [
'exim' => '/[0-9]{3} OK id=(.*)/',
Expand All @@ -156,8 +162,10 @@ class SMTP
];

/**
* @var string|bool|null The last transaction ID issued in response to a DATA command,
* if one was detected
* The last transaction ID issued in response to a DATA command,
* if one was detected.
*
* @var string|bool|null
*/
protected $last_smtp_transaction_id;

Expand Down
2 changes: 0 additions & 2 deletions test/phpmailerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ public function tearDown()
}
}


/**
* Build the body of the message in the appropriate format.
*/
Expand Down Expand Up @@ -2082,7 +2081,6 @@ public function testMiscellaneous()
$this->assertEquals(PHPMailer::normalizeBreaks($b3), $t1, 'Failed to normalize line breaks (3)');
}


public function testBadSMTP()
{
$this->Mail->smtpConnect();
Expand Down

0 comments on commit 700ea09

Please sign in to comment.