summaryrefslogtreecommitdiffstats
path: root/system/libraries/Email.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2017-04-06 13:36:19 +0200
committerAndrey Andreev <narf@devilix.net>2017-04-06 13:36:19 +0200
commitb9e45e32d89f2cba80f88becb0d52c92898e3a1d (patch)
tree6d5656c5300e8790a49c9b7a62ff632c6e0b624c /system/libraries/Email.php
parentbdcafdfa204b041493707caa277915e00a124eaf (diff)
[ci skip] Simplify some internal CI_Email code
Diffstat (limited to 'system/libraries/Email.php')
-rw-r--r--system/libraries/Email.php24
1 files changed, 8 insertions, 16 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index d4b938701..0e9cf0574 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -913,18 +913,13 @@ class CI_Email {
/**
* Get Mail Protocol
*
- * @param bool
* @return mixed
*/
- protected function _get_protocol($return = TRUE)
+ protected function _get_protocol()
{
$this->protocol = strtolower($this->protocol);
in_array($this->protocol, $this->_protocols, TRUE) OR $this->protocol = 'mail';
-
- if ($return === TRUE)
- {
- return $this->protocol;
- }
+ return $this->protocol;
}
// --------------------------------------------------------------------
@@ -932,10 +927,9 @@ class CI_Email {
/**
* Get Mail Encoding
*
- * @param bool
* @return string
*/
- protected function _get_encoding($return = TRUE)
+ protected function _get_encoding()
{
in_array($this->_encoding, $this->_bit_depths) OR $this->_encoding = '8bit';
@@ -947,10 +941,7 @@ class CI_Email {
}
}
- if ($return === TRUE)
- {
- return $this->_encoding;
- }
+ return $this->_encoding;
}
// --------------------------------------------------------------------
@@ -1829,14 +1820,15 @@ class CI_Email {
{
$this->_unwrap_specials();
- $method = '_send_with_'.$this->_get_protocol();
+ $protocol = $this->_get_protocol();
+ $method = '_send_with_'.$protocol;
if ( ! $this->$method())
{
- $this->_set_error_message('lang:email_send_failure_'.($this->_get_protocol() === 'mail' ? 'phpmail' : $this->_get_protocol()));
+ $this->_set_error_message('lang:email_send_failure_'.($protocol === 'mail' ? 'phpmail' : $protocol));
return FALSE;
}
- $this->_set_error_message('lang:email_sent', $this->_get_protocol());
+ $this->_set_error_message('lang:email_sent', $protocol);
return TRUE;
}