Skip to content

Commit eb22231

Browse files
committed
docs: improve comments in Validation
1 parent 9f1fdc6 commit eb22231

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

system/Validation/Validation.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -462,14 +462,14 @@ public function withRequest(RequestInterface $request): ValidationInterface
462462
}
463463

464464
/**
465-
* Sets an individual rule and custom error messages for a single field.
465+
* Sets (or adds) an individual rule and custom error messages for a single
466+
* field.
466467
*
467468
* The custom error message should be just the messages that apply to
468469
* this field, like so:
469-
*
470470
* [
471-
* 'rule' => 'message',
472-
* 'rule' => 'message',
471+
* 'rule1' => 'message1',
472+
* 'rule2' => 'message2',
473473
* ]
474474
*
475475
* @param array|string $rules
@@ -502,21 +502,21 @@ public function setRule(string $field, ?string $label, $rules, array $errors = [
502502

503503
/**
504504
* Stores the rules that should be used to validate the items.
505-
* Rules should be an array formatted like:
506505
*
506+
* Rules should be an array formatted like:
507507
* [
508508
* 'field' => 'rule1|rule2'
509509
* ]
510510
*
511511
* The $errors array should be formatted like:
512512
* [
513513
* 'field' => [
514-
* 'rule' => 'message',
515-
* 'rule' => 'message
514+
* 'rule1' => 'message1',
515+
* 'rule2' => 'message2',
516516
* ],
517517
* ]
518518
*
519-
* @param array $errors // An array of custom error messages
519+
* @param array $errors An array of custom error messages
520520
*/
521521
public function setRules(array $rules, array $errors = []): ValidationInterface
522522
{

0 commit comments

Comments
 (0)