Making FormHelper::inputDefaults() code more readable #664

Merged
merged 1 commit into from May 21, 2012
@@ -2592,7 +2592,11 @@ protected function _initInputField($field, $options = array()) {
*/
public function inputDefaults($defaults = null, $merge = false) {
if (!is_null($defaults)) {
- $this->_inputDefaults = array_merge($merge ? $this->_inputDefaults : array(), (array)$defaults);
+ if ($merge) {
+ $this->_inputDefaults = array_merge($this->_inputDefaults, (array)$defaults);
+ } else {
+ $this->_inputDefaults = (array)$defaults;
+ }
}
return $this->_inputDefaults;
}