From 47526e8b4d1134f261182998f9fb077b4e68b6a4 Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 1 Mar 2013 22:34:00 -0500 Subject: [PATCH] Refactor code to not use extract()/compact() --- lib/Cake/Network/Email/CakeEmail.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/Cake/Network/Email/CakeEmail.php b/lib/Cake/Network/Email/CakeEmail.php index ade7921f806..7e5460cc502 100644 --- a/lib/Cake/Network/Email/CakeEmail.php +++ b/lib/Cake/Network/Email/CakeEmail.php @@ -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; }