Skip to content

Commit

Permalink
Refactor code to not use extract()/compact()
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Mar 2, 2013
1 parent 8eb5ce4 commit 47526e8
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/Cake/Network/Email/CakeEmail.php
Expand Up @@ -1065,16 +1065,21 @@ public function send($content = null) {

$contents = $this->transportClass()->send($this);
if (!empty($this->_config['log'])) {
$level = LOG_DEBUG;
$scope = 'email';
$config = array(
'level' => LOG_DEBUG,
'scope' => 'email'
);
if ($this->_config['log'] !== true) {
if (!is_array($this->_config['log'])) {
$this->_config['log'] = array('level' => $this->_config['log']);
}
$this->_config['log'] = array_merge(compact('level', 'scope'), $this->_config['log']);
extract($this->_config['log']);
$config = array_merge($config, $this->_config['log']);
}
CakeLog::write($level, PHP_EOL . $contents['headers'] . PHP_EOL . $contents['message'], $scope);
CakeLog::write(
$config['level'],
PHP_EOL . $contents['headers'] . PHP_EOL . $contents['message'],
$config['scope']
);
}
return $contents;
}
Expand Down

0 comments on commit 47526e8

Please sign in to comment.