You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[Assert\Length(exactMessage: 'custom Length exact message from attribute from named argument')]
12
+
publicstring$bar2;
13
+
14
+
#[Assert\Length(exactMessage: 'custom Length exact message from attribute from named argument 1/2', minMessage: 'custom Length min message from attribute from named argument 2/2')]
15
+
publicstring$bar3;
16
+
17
+
#[Assert\Isbn('isbn10', 'custom Isbn message from attribute')] // no way to handle those arguments (not named, not in associative array).
18
+
publicstring$isbn;
19
+
20
+
#[Assert\Isbn([
21
+
'type' => 'isbn10',
22
+
'message' => 'custom Isbn message from attribute with options as array',
23
+
])]
24
+
publicstring$isbn2;
10
25
}
11
26
12
27
class Foo2
13
28
{
14
29
publicfunctionindex()
15
30
{
16
-
$constraint1 = newAssert\Isbn([
17
-
'message' => 'custom Isbn message',
18
-
]);
19
-
20
-
$constraint2 = newAssert\Length([
21
-
'exactMessage' => 'custom Length exact message',
31
+
$constraint1 = newAssert\Isbn('isbn10', 'custom Isbn message'); // no way to handle those arguments (not named, not in associative array).
32
+
$constraint2 = newAssert\Isbn([
33
+
'type' => 'isbn10',
34
+
'message' => 'custom Isbn message with options as array',
22
35
]);
36
+
$constraint3 = newAssert\Isbn(message: 'custom Isbn message from named argument');
37
+
$constraint4 = newAssert\Length(exactMessage: 'custom Length exact message from named argument');
38
+
$constraint5 = newAssert\Length(exactMessage: 'custom Length exact message from named argument 1/2', minMessage: 'custom Length min message from named argument 2/2');
0 commit comments