|
22 | 22 | /** |
23 | 23 | * Validator |
24 | 24 | */ |
25 | | -class Validation implements ValidationInterface |
| 25 | +class Validation |
26 | 26 | { |
27 | 27 | /** |
28 | 28 | * Files to load with validation functions. |
@@ -344,8 +344,10 @@ protected function processRules(string $field, ?string $label, $value, $rules = |
344 | 344 | /** |
345 | 345 | * Takes a Request object and grabs the input data to use from its |
346 | 346 | * array values. |
| 347 | + * |
| 348 | + * @return $this |
347 | 349 | */ |
348 | | - public function withRequest(RequestInterface $request): ValidationInterface |
| 350 | + public function withRequest(RequestInterface $request) |
349 | 351 | { |
350 | 352 | /** @var IncomingRequest $request */ |
351 | 353 | if (strpos($request->getHeaderLine('Content-Type'), 'application/json') !== false) { |
@@ -421,8 +423,10 @@ public function setRule(string $field, ?string $label, $rules, array $errors = [ |
421 | 423 | * ] |
422 | 424 | * |
423 | 425 | * @param array $errors // An array of custom error messages |
| 426 | + * |
| 427 | + * @return $this |
424 | 428 | */ |
425 | | - public function setRules(array $rules, array $errors = []): ValidationInterface |
| 429 | + public function setRules(array $rules, array $errors = []) |
426 | 430 | { |
427 | 431 | $this->customErrors = $errors; |
428 | 432 |
|
@@ -691,8 +695,10 @@ public function getErrors(): array |
691 | 695 |
|
692 | 696 | /** |
693 | 697 | * Sets the error for a specific field. Used by custom validation methods. |
| 698 | + * |
| 699 | + * @return $this |
694 | 700 | */ |
695 | | - public function setError(string $field, string $error): ValidationInterface |
| 701 | + public function setError(string $field, string $error) |
696 | 702 | { |
697 | 703 | $this->errors[$field] = $error; |
698 | 704 |
|
@@ -772,8 +778,10 @@ protected function splitRules(string $rules): array |
772 | 778 | /** |
773 | 779 | * Resets the class to a blank slate. Should be called whenever |
774 | 780 | * you need to process more than one array. |
| 781 | + * |
| 782 | + * @return $this |
775 | 783 | */ |
776 | | - public function reset(): ValidationInterface |
| 784 | + public function reset() |
777 | 785 | { |
778 | 786 | $this->data = []; |
779 | 787 | $this->rules = []; |
|
0 commit comments