Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 1 | <?php |
| 2 | |
| 3 | namespace Illuminate\Contracts\Validation; |
| 4 | |
| 5 | use Illuminate\Contracts\Support\MessageProvider; |
| 6 | |
| 7 | interface Validator extends MessageProvider |
| 8 | { |
| 9 | /** |
| 10 | * Run the validator's rules against its data. |
| 11 | * |
| 12 | * @return array |
| 13 | * |
| 14 | * @throws \Illuminate\Validation\ValidationException |
| 15 | */ |
| 16 | public function validate(); |
| 17 | |
| 18 | /** |
| 19 | * Get the attributes and values that were validated. |
| 20 | * |
| 21 | * @return array |
| 22 | * |
| 23 | * @throws \Illuminate\Validation\ValidationException |
| 24 | */ |
| 25 | public function validated(); |
| 26 | |
| 27 | /** |
| 28 | * Determine if the data fails the validation rules. |
| 29 | * |
| 30 | * @return bool |
| 31 | */ |
| 32 | public function fails(); |
| 33 | |
| 34 | /** |
| 35 | * Get the failed validation rules. |
| 36 | * |
| 37 | * @return array |
| 38 | */ |
| 39 | public function failed(); |
| 40 | |
| 41 | /** |
| 42 | * Add conditions to a given field based on a Closure. |
| 43 | * |
| 44 | * @param string|array $attribute |
| 45 | * @param string|array $rules |
| 46 | * @param callable $callback |
| 47 | * @return $this |
| 48 | */ |
| 49 | public function sometimes($attribute, $rules, callable $callback); |
| 50 | |
| 51 | /** |
| 52 | * Add an after validation callback. |
| 53 | * |
| 54 | * @param callable|string $callback |
| 55 | * @return $this |
| 56 | */ |
| 57 | public function after($callback); |
| 58 | |
| 59 | /** |
| 60 | * Get all of the validation error messages. |
| 61 | * |
| 62 | * @return \Illuminate\Support\MessageBag |
| 63 | */ |
| 64 | public function errors(); |
| 65 | } |