Skip to content

Commit

Permalink
errorHandler is not static
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Aug 29, 2016
1 parent d941270 commit 7c1154b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions class.smtp.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public function connect($host, $port = null, $timeout = 30, $options = array())
$errstr = '';
if ($streamok) {
$socket_context = stream_context_create($options);
set_error_handler(array('self', 'errorHandler'));
set_error_handler(array($this, 'errorHandler'));
$this->smtp_conn = stream_socket_client(
$host . ":" . $port,
$errno,
Expand All @@ -288,7 +288,7 @@ public function connect($host, $port = null, $timeout = 30, $options = array())
"Connection: stream_socket_client not available, falling back to fsockopen",
self::DEBUG_CONNECTION
);
set_error_handler(array('self', 'errorHandler'));
set_error_handler(array($this, 'errorHandler'));
$this->smtp_conn = fsockopen(
$host,
$port,
Expand Down Expand Up @@ -1198,7 +1198,7 @@ public function getTimeout()
* @param integer $errno The error number returned by PHP.
* @param string $errmsg The error message returned by PHP.
*/
function errorHandler($errno, $errmsg)
protected function errorHandler($errno, $errmsg)
{
$notice = 'Connection: Failed to connect to server.';
$this->setError(
Expand Down

0 comments on commit 7c1154b

Please sign in to comment.