Skip to content

Commit 0795d65

Browse files
minor #60674 re-add accidentally removed changelog examples (xabbuh)
This PR was merged into the 7.3 branch. Discussion ---------- re-add accidentally removed changelog examples | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT I gues removing these lines was not intended in #59274 Commits ------- 73ecbca re-add accidentally removed changelog examples
2 parents cadcc57 + 73ecbca commit 0795d65

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

src/Symfony/Component/Validator/CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,55 @@ CHANGELOG
66

77
* Add the `filenameCharset` and `filenameCountUnit` options to the `File` constraint
88
* 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+
```
939
* 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+
```
1058
* Add support for ratio checks for SVG files to the `Image` constraint
1159
* Add support for the `otherwise` option in the `When` constraint
1260
* Add support for multiple fields containing nested constraints in `Composite` constraints

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy