Skip to content

Commit 4a2a45f

Browse files
committed
Upgrade note on validator constraints
1 parent 6c3f73c commit 4a2a45f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

UPGRADE.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,31 @@ Priority of the two-factor authenticator has changed from `0` to `-100`. Please
1010
is still working fine, especially when you're using custom (non-official) authenticators. You might need to adjust
1111
the priority of your custom authenticator.
1212

13+
When using the validator constraints `UserTotpCode` or `UserGoogleTotpCode` under Symfony 8, you can no longer pass the
14+
options as an associative array. Use constructor arguments instead. You can use named arguments.
15+
16+
Before:
17+
18+
```php
19+
// Attribute
20+
#[UserTotpCode(['message': 'The authentication code is invalid'])]
21+
public string $code;
22+
23+
// Programmatic
24+
new UserTotpCode(['message': 'The authentication code is invalid'])
25+
```
26+
27+
After:
28+
29+
```php
30+
// Attribute
31+
#[UserTotpCode(message: 'The authentication code is invalid')]
32+
public string $code;
33+
34+
// Programmatic
35+
new UserTotpCode(message: 'The authentication code is invalid')
36+
```
37+
1338

1439
6.x to 7.x
1540
----------

0 commit comments

Comments
 (0)