Core\Validator: Fix addRules() method for array
This commit is contained in:
parent
e42fc8d9f0
commit
0cf80df852
1 changed files with 7 additions and 7 deletions
|
@ -172,17 +172,17 @@ class Validator
|
|||
}
|
||||
}
|
||||
|
||||
if (
|
||||
'array' === $name
|
||||
&& ! \is_array($rule)
|
||||
) {
|
||||
$rule = [];
|
||||
}
|
||||
|
||||
$rules[$name] = $rule ?? '';
|
||||
}
|
||||
|
||||
if (isset($suffix)) {
|
||||
if (
|
||||
isset($this->rules[$field]['array'])
|
||||
&& ! \is_array($this->rules[$field]['array'])
|
||||
) {
|
||||
$this->rules[$field]['array'] = [];
|
||||
}
|
||||
|
||||
$this->rules[$field]['array'][$suffix] = $rules;
|
||||
} else {
|
||||
$this->rules[$field] = $rules;
|
||||
|
|
Loading…
Add table
Reference in a new issue