mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-06 11:32:40 +00:00
microptimize options and default merge and other string key array merges
This commit is contained in:
parent
8d47ef43e5
commit
0ece694a75
35 changed files with 121 additions and 133 deletions
|
@ -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']);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue