Skip to content

Commit

Permalink
remove some vars
Browse files Browse the repository at this point in the history
  • Loading branch information
miya0001 committed Aug 9, 2015
1 parent 08b5653 commit 2c572d3
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions lib/VCCW_MailCatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Mailcatcher class.
*
* @since 1.0
* @since 0.1.0
* @package Mailcatcher
*/

Expand All @@ -14,31 +14,27 @@ class VCCW_MailCatcher {
/**
* Send in arguments for mailer.
*
* @since 1.0
* @since 0.1.0
* @access public
* @param array $config Configuration values. These will take presedence over $defaults.
*/
public function __construct( array $config = array() )
{
// Setup our defaults
$defaults = array(
"from" => "local@local.dev",
"fromname" => "local",
"host" => "127.0.0.1",
"port" => "1025",
"smtpauth" => false
);

$config = wp_parse_args( $config, $defaults );

// Setup mailer
$this->setupMail( $config );
}

/**
* Setup mailer.
*
* @since 1.0
* @since 0.1.0
* @access private
* @param array $config Parsed configuration values.
*/
Expand All @@ -48,9 +44,6 @@ private function setupMail( array $config )

extract( $config, EXTR_SKIP );

$phpmailer->From = $from;
$phpmailer->FromName = $fromname;
$phpmailer->Sender = $phpmailer->From;
$phpmailer->Host = $host;
$phpmailer->Port = ( int ) $port;
$phpmailer->SMTPAuth = ( boolean ) $smtpauth;
Expand All @@ -61,10 +54,4 @@ private function setupMail( array $config )
}


$mailcatcher = new VCCW_MailCatcher( array(
"from" => "dev@local.dev",
"fromname" => "dev",
"host" => "127.0.0.1",
"port" => "1025",
"smtpauth" => false
) );
$mailcatcher = new VCCW_MailCatcher();

0 comments on commit 2c572d3

Please # to comment.