Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit fdaedea

Browse files
committed
Merge branch 'hotfix/docs'
Close #238 Close #239
2 parents 91ff0ce + eb28255 commit fdaedea

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

doc/book/validator-chains.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ use Zend\Validator\StringLength;
1111
use Zend\Validator\ValidatorChain;
1212

1313
// Create a validator chain and add validators to it
14-
$chain = new ValidatorChain();
15-
$chain->attach(new StringLength(['min' => 6, 'max' => 12]));
16-
$chain->attach(new Alnum());
14+
$validatorChain = new ValidatorChain();
15+
$validatorChain->attach(new StringLength(['min' => 6, 'max' => 12]));
16+
$validatorChain->attach(new Alnum());
1717

1818
// Validate the username
1919
if ($validatorChain->isValid($username)) {
@@ -43,7 +43,7 @@ written as follows, then the alphanumeric validation would not occur if the
4343
string length validation fails:
4444

4545
```php
46-
$chain->attach(new StringLength(['min' => 6, 'max' => 12], true));
46+
$chain->attach(new StringLength(['min' => 6, 'max' => 12]), true);
4747
$chain->attach(new Alnum());
4848
```
4949

@@ -69,13 +69,13 @@ use Zend\Validator\ValidatorChain;
6969
$username = 'ABCDFE';
7070

7171
// Create a validator chain and add validators to it
72-
$chain = new ValidatorChain();
73-
$chain->attach(
72+
$validatorChain = new ValidatorChain();
73+
$validatorChain->attach(
7474
new StringLength(['min' => 3, 'max' => 5]),
7575
true, // break chain on failure
7676
1
7777
);
78-
$chain->attach(
78+
$validatorChain->attach(
7979
new StringLength(['min' => 7, 'max' => 9]),
8080
true, // break chain on failure
8181
2 // higher priority!

0 commit comments

Comments
 (0)