Skip to content

Commit

Permalink
Merge pull request #15819 from cakephp/docs
Browse files Browse the repository at this point in the history
Update docblocks
  • Loading branch information
othercorey committed Sep 3, 2021
2 parents bff920a + 8d8864f commit d7612bd
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/Validation/ValidatorAwareTrait.php
Expand Up @@ -68,11 +68,12 @@ trait ValidatorAwareTrait
* ```
* public function validationForSubscription($validator)
* {
* return $validator
* ->add('email', 'valid-email', ['rule' => 'email'])
* ->add('password', 'valid', ['rule' => 'notBlank'])
* ->requirePresence('username');
* return $validator
* ->add('email', 'valid-email', ['rule' => 'email'])
* ->add('password', 'valid', ['rule' => 'notBlank'])
* ->requirePresence('username');
* }
*
* $validator = $this->getValidator('forSubscription');
* ```
*
Expand Down Expand Up @@ -143,11 +144,11 @@ protected function createValidator(string $name): Validator
* You can build the object by yourself and store it in your object:
*
* ```
* $validator = new \Cake\Validation\Validator($table);
* $validator = new \Cake\Validation\Validator();
* $validator
* ->add('email', 'valid-email', ['rule' => 'email'])
* ->add('password', 'valid', ['rule' => 'notBlank'])
* ->allowEmpty('bio');
* ->add('email', 'valid-email', ['rule' => 'email'])
* ->add('password', 'valid', ['rule' => 'notBlank'])
* ->allowEmpty('bio');
* $this->setValidator('forSubscription', $validator);
* ```
*
Expand Down

0 comments on commit d7612bd

Please sign in to comment.