8000 minor #10306 [Validator] Improve condition in if statement (nicoweb) · symfony/symfony-docs@015ba0c · GitHub
[go: up one dir, main page]

Skip to content

Commit 015ba0c

Browse files
committed
minor #10306 [Validator] Improve condition in if statement (nicoweb)
This PR was merged into the 3.4 branch. Discussion ---------- [Validator] Improve condition in if statement Commits ------- 9919dcc [Validator] fix condition in if statement
2 parents 795febe + 9919dcc commit 015ba0c

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