8000 [Validator] fix condition in if statement · symfony/symfony-docs@9919dcc · GitHub
[go: up one dir, main page]

Skip to content

Commit 9919dcc

Browse files
authored
[Validator] fix condition in if statement
1 parent 795febe commit 9919dcc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/validator.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ If you have lots of validation errors, you can filter them by error code::
6060
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
6161

6262
$violations = $validator->validate(...);
63-
if (count($violations->findByCodes(UniqueEntity::NOT_UNIQUE_ERROR))) {
63+
if (0 !== count($violations->findByCodes(UniqueEntity::NOT_UNIQUE_ERROR))) {
6464
// handle this specific error (display some message, send an email, etc.)
6565
}
6666

0 commit comments

Comments
 (0)
0