Skip to content

Commit d889012

Browse files
committed
use named arguments to configure validation constraints
1 parent 0c031e7 commit d889012

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

validation/raw_values.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ Validation of arrays is possible using the ``Collection`` constraint::
7878
'eye_color' => new Assert\Choice(choices: [3, 4]),
7979
'file' => new Assert\File(),
8080
'password' => new Assert\Length(['min' => 60]),
81-
'tags' => new Assert\Optional([
82-
new Assert\Type('array'),
83-
new Assert\Count(['min' => 1]),
81+
'tags' => new Assert\Optional(constraints: [
82+
new Assert\Type(type: 'array'),
83+
new Assert\Count(min: 1),
8484
new Assert\All([
85-
new Assert\Collection([
85+
new Assert\Collection(constraints: [
8686
'slug' => [
8787
new Assert\NotBlank(),
8888
new Assert\Type(['type' => 'string']),
@@ -91,7 +91,7 @@ Validation of arrays is possible using the ``Collection`` constraint::
9191
new Assert\NotBlank(),
9292
],
9393
]),
94-
new CustomUniqueTagValidator(['groups' => 'custom']),
94+
new CustomUniqueTagValidator(groups: ['custom']),
9595
]),
9696
]),
9797
]);

0 commit comments

Comments
 (0)