Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9919dcc

Browse filesBrowse files
authored
[Validator] fix condition in if statement
1 parent 795febe commit 9919dcc
Copy full SHA for 9919dcc

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎components/validator.rst

Copy file name to clipboardExpand all lines: components/validator.rst
+1-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.