Update Core\Validator for new Fork\__() function

Now an error array contains untranslated strings or template arrays.
Translation must be made in the output template iswev.
This commit is contained in:
Visman 2021-03-11 23:23:59 +07:00
parent decb014b9c
commit be429ea4c3

View file

@ -371,7 +371,7 @@ class Validator
list($type, $error) = $error;
}
$this->errors[$type][] = __([$error, [':alias' => __($alias), ':attr' => $attr]]);
$this->errors[$type][] = [$error, [':alias' => __($alias), ':attr' => $attr]];
$this->error = true;
}
@ -440,9 +440,10 @@ class Validator
public function getErrorsWithoutType(): array
{
$result = [];
\array_walk_recursive($this->errors, function ($item) use (&$result) {
$result[] = $item;
});
foreach ($this->errors as $errors) {
\array_push($result, ...$errors);
}
return $result;
}