File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,55 @@ CHANGELOG
6
6
7
7
* Add the ` filenameCharset ` and ` filenameCountUnit ` options to the ` File ` constraint
8
8
* Deprecate defining custom constraints not supporting named arguments
9
+
10
+ Before:
11
+
12
+ ``` php
13
+ use Symfony\Component\Validator\Constraint;
14
+
15
+ class CustomConstraint extends Constraint
16
+ {
17
+ public function __construct(array $options)
18
+ {
19
+ // ...
20
+ }
21
+ }
22
+ ```
23
+
24
+ After:
25
+
26
+ ``` php
27
+ use Symfony\Component\Validator\Attribute\HasNamedArguments;
28
+ use Symfony\Component\Validator\Constraint;
29
+
30
+ class CustomConstraint extends Constraint
31
+ {
32
+ #[HasNamedArguments]
33
+ public function __construct($option1, $option2, $groups, $payload)
34
+ {
35
+ // ...
36
+ }
37
+ }
38
+ ```
9
39
* Deprecate passing an array of options to the constructors of the constraint classes, pass each option as a dedicated argument instead
40
+
41
+ Before:
42
+
43
+ ``` php
44
+ new NotNull([
45
+ 'groups' => ['foo', 'bar'],
46
+ 'message' => 'a custom constraint violation message',
47
+ ])
48
+ ```
49
+
50
+ After:
51
+
52
+ ``` php
53
+ new NotNull(
54
+ groups: ['foo', 'bar'],
55
+ message: 'a custom constraint violation message',
56
+ )
57
+ ```
10
58
* Add support for ratio checks for SVG files to the ` Image ` constraint
11
59
* Add support for the ` otherwise ` option in the ` When ` constraint
12
60
* Add support for multiple fields containing nested constraints in ` Composite ` constraints
You can’t perform that action at this time.
0 commit comments