Skip to content

Commit

Permalink
Inline method that doesn't need to exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Aug 27, 2013
1 parent c07d4b2 commit 4bace1a
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions lib/Cake/Network/Email/Email.php
Expand Up @@ -1237,30 +1237,21 @@ public static function deliver($to = null, $subject = null, $message = null, $tr
return $instance;
}

/**
* Read the configuration profile for a given name.
*
* @param string $name The name to read.
* @return array
* @throws Cake\Error\Exception When using a configuration that doesn't exist.
*/
protected function _getConfig($name) {
$config = static::config($name);
if (empty($config)) {
throw new Error\Exception(__d('cake_dev', 'Unknown email configuration "%s".', $name));
}
return $config;
}

/**
* Apply the config to an instance
*
* @param string|array $config
* @return void
* @throws Cake\Error\Exception When using a configuration that doesn't exist.
*/
protected function _applyConfig($config) {
if (is_string($config)) {
$config = $this->_getConfig($config);
$name = $config;
$config = static::config($name);
if (empty($config)) {
throw new Error\Exception(__d('cake_dev', 'Unknown email configuration "%s".', $name));
}
unset($name);
}
$this->_profile = array_merge($this->_profile, $config);
if (!empty($config['charset'])) {
Expand Down

0 comments on commit 4bace1a

Please sign in to comment.