Browse Source

Reformat code te be PSR-2 compatible

tags/2.0.0-beta
SonicGD 11 years ago
parent
commit
3db18c198a
  1. 5
      Mailer.php
  2. 14
      Message.php

5
Mailer.php

@ -96,6 +96,7 @@ class Mailer extends BaseMailer
if (!is_object($this->_swiftMailer)) { if (!is_object($this->_swiftMailer)) {
$this->_swiftMailer = $this->createSwiftMailer(); $this->_swiftMailer = $this->createSwiftMailer();
} }
return $this->_swiftMailer; return $this->_swiftMailer;
} }
@ -119,6 +120,7 @@ class Mailer extends BaseMailer
if (!is_object($this->_transport)) { if (!is_object($this->_transport)) {
$this->_transport = $this->createTransport($this->_transport); $this->_transport = $this->createTransport($this->_transport);
} }
return $this->_transport; return $this->_transport;
} }
@ -132,6 +134,7 @@ class Mailer extends BaseMailer
$address = implode(', ', array_keys($address)); $address = implode(', ', array_keys($address));
} }
Yii::info('Sending email "' . $message->getSubject() . '" to "' . $address . '"', __METHOD__); Yii::info('Sending email "' . $message->getSubject() . '" to "' . $address . '"', __METHOD__);
return $this->getSwiftMailer()->send($message->getSwiftMessage()) > 0; return $this->getSwiftMailer()->send($message->getSwiftMessage()) > 0;
} }
@ -169,6 +172,7 @@ class Mailer extends BaseMailer
$transport->registerPlugin($plugin); $transport->registerPlugin($plugin);
} }
} }
return $transport; return $transport;
} }
@ -215,6 +219,7 @@ class Mailer extends BaseMailer
} }
} }
} }
return $object; return $object;
} }
} }

14
Message.php

@ -37,6 +37,7 @@ class Message extends BaseMessage
if (!is_object($this->_swiftMessage)) { if (!is_object($this->_swiftMessage)) {
$this->_swiftMessage = $this->createSwiftMessage(); $this->_swiftMessage = $this->createSwiftMessage();
} }
return $this->_swiftMessage; return $this->_swiftMessage;
} }
@ -54,6 +55,7 @@ class Message extends BaseMessage
public function setCharset($charset) public function setCharset($charset)
{ {
$this->getSwiftMessage()->setCharset($charset); $this->getSwiftMessage()->setCharset($charset);
return $this; return $this;
} }
@ -71,6 +73,7 @@ class Message extends BaseMessage
public function setFrom($from) public function setFrom($from)
{ {
$this->getSwiftMessage()->setFrom($from); $this->getSwiftMessage()->setFrom($from);
return $this; return $this;
} }
@ -88,6 +91,7 @@ class Message extends BaseMessage
public function setReplyTo($replyTo) public function setReplyTo($replyTo)
{ {
$this->getSwiftMessage()->setReplyTo($replyTo); $this->getSwiftMessage()->setReplyTo($replyTo);
return $this; return $this;
} }
@ -105,6 +109,7 @@ class Message extends BaseMessage
public function setTo($to) public function setTo($to)
{ {
$this->getSwiftMessage()->setTo($to); $this->getSwiftMessage()->setTo($to);
return $this; return $this;
} }
@ -122,6 +127,7 @@ class Message extends BaseMessage
public function setCc($cc) public function setCc($cc)
{ {
$this->getSwiftMessage()->setCc($cc); $this->getSwiftMessage()->setCc($cc);
return $this; return $this;
} }
@ -139,6 +145,7 @@ class Message extends BaseMessage
public function setBcc($bcc) public function setBcc($bcc)
{ {
$this->getSwiftMessage()->setBcc($bcc); $this->getSwiftMessage()->setBcc($bcc);
return $this; return $this;
} }
@ -156,6 +163,7 @@ class Message extends BaseMessage
public function setSubject($subject) public function setSubject($subject)
{ {
$this->getSwiftMessage()->setSubject($subject); $this->getSwiftMessage()->setSubject($subject);
return $this; return $this;
} }
@ -165,6 +173,7 @@ class Message extends BaseMessage
public function setTextBody($text) public function setTextBody($text)
{ {
$this->setBody($text, 'text/plain'); $this->setBody($text, 'text/plain');
return $this; return $this;
} }
@ -174,6 +183,7 @@ class Message extends BaseMessage
public function setHtmlBody($html) public function setHtmlBody($html)
{ {
$this->setBody($html, 'text/html'); $this->setBody($html, 'text/html');
return $this; return $this;
} }
@ -236,6 +246,7 @@ class Message extends BaseMessage
$attachment->setContentType($options['contentType']); $attachment->setContentType($options['contentType']);
} }
$this->getSwiftMessage()->attach($attachment); $this->getSwiftMessage()->attach($attachment);
return $this; return $this;
} }
@ -252,6 +263,7 @@ class Message extends BaseMessage
$attachment->setContentType($options['contentType']); $attachment->setContentType($options['contentType']);
} }
$this->getSwiftMessage()->attach($attachment); $this->getSwiftMessage()->attach($attachment);
return $this; return $this;
} }
@ -267,6 +279,7 @@ class Message extends BaseMessage
if (!empty($options['contentType'])) { if (!empty($options['contentType'])) {
$embedFile->setContentType($options['contentType']); $embedFile->setContentType($options['contentType']);
} }
return $this->getSwiftMessage()->embed($embedFile); return $this->getSwiftMessage()->embed($embedFile);
} }
@ -282,6 +295,7 @@ class Message extends BaseMessage
if (!empty($options['contentType'])) { if (!empty($options['contentType'])) {
$embedFile->setContentType($options['contentType']); $embedFile->setContentType($options['contentType']);
} }
return $this->getSwiftMessage()->embed($embedFile); return $this->getSwiftMessage()->embed($embedFile);
} }

Loading…
Cancel
Save