microptimize options and default merge and other string key array merges

This commit is contained in:
euromark 2014-04-08 01:25:14 +02:00
parent 8d47ef43e5
commit 0ece694a75
35 changed files with 121 additions and 133 deletions

View file

@ -575,7 +575,7 @@ class Validation {
*/
public static function multiple($check, $options = array(), $caseInsensitive = false) {
$defaults = array('in' => null, 'max' => null, 'min' => null);
$options = array_merge($defaults, $options);
$options += $defaults;
$check = array_filter((array)$check);
if (empty($check)) {
@ -890,7 +890,7 @@ class Validation {
'deep' => false,
'type' => null
);
$params = array_merge($defaults, $params);
$params += $defaults;
if ($params['country'] !== null) {
$params['country'] = mb_strtolower($params['country']);
}