Skip to content

Commit

Permalink
Documentation and declaration of object type in method's parameter
Browse files Browse the repository at this point in the history
This should make pass the phpcs check. #9199
  • Loading branch information
Linnk committed Aug 1, 2016
1 parent 93db51c commit d37f88b
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/Cake/Network/Email/SmtpTransport.php
Expand Up @@ -226,6 +226,7 @@ protected function _prepareRcptCmd($email) {
/**
* Prepares the `from` email address.
*
* @param CakeEmail $email CakeEmail
* @return array
*/
protected function _prepareFromAddress($email) {
Expand All @@ -239,9 +240,10 @@ protected function _prepareFromAddress($email) {
/**
* Prepares the recipient email addresses.
*
* @param CakeEmail $email CakeEmail
* @return array
*/
protected function _prepareRecipientAddresses($email) {
protected function _prepareRecipientAddresses(CakeEmail $email) {
$to = $email->to();
$cc = $email->cc();
$bcc = $email->bcc();
Expand All @@ -251,18 +253,20 @@ protected function _prepareRecipientAddresses($email) {
/**
* Prepares the message headers.
*
* @param CakeEmail $email CakeEmail
* @return array
*/
protected function _prepareMessageHeaders($email) {
protected function _prepareMessageHeaders(CakeEmail $email) {
return $email->getHeaders(array('from', 'sender', 'replyTo', 'readReceipt', 'to', 'cc', 'subject'));
}

/**
* Prepares the message body.
*
* @param CakeEmail $email CakeEmail
* @return string
*/
protected function _prepareMessage($email) {
protected function _prepareMessage(CakeEmail $email) {
$lines = $email->message();
$messages = array();
foreach ($lines as $line) {
Expand All @@ -278,10 +282,11 @@ protected function _prepareMessage($email) {
/**
* Send emails
*
* @param CakeEmail $email CakeEmail
* @return void
* @throws SocketException
*/
protected function _sendRcpt($email) {
protected function _sendRcpt(CakeEmail $email) {
$from = $this->_prepareFromAddress($email);
$this->_smtpSend($this->_prepareFromCmd(key($from)));

Expand All @@ -294,10 +299,11 @@ protected function _sendRcpt($email) {
/**
* Send Data
*
* @param CakeEmail $email CakeEmail
* @return void
* @throws SocketException
*/
protected function _sendData($email) {
protected function _sendData(CakeEmail $email) {
$this->_smtpSend('DATA', '354');

$headers = $this->_headersToString($this->_prepareMessageHeaders($email));
Expand Down

0 comments on commit d37f88b

Please sign in to comment.