1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | |
7: | |
8: | namespace Aurora\System; |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: | class Validator |
18: | { |
19: | public static function validate(array $aInputs, array $aRules, $aMessages = []) |
20: | { |
21: | $validation = (new \Rakit\Validation\Validator())->validate($aInputs, $aRules, $aMessages); |
22: | if ($validation->fails()) { |
23: | $errors = $validation->errors(); |
24: | throw new \Aurora\System\Exceptions\ValidationException(implode("; ", $errors->all()), \Aurora\System\Notifications::InvalidInputParameter); |
25: | } |
26: | } |
27: | } |
28: | |