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 4fcb24b

Browse filesBrowse files
apetitpafabpot
apetitpa
authored andcommitted
Move empty condition in return statement
1 parent a090ef8 commit 4fcb24b
Copy full SHA for 4fcb24b

File tree

1 file changed

+2
-10
lines changed
Filter options

1 file changed

+2
-10
lines changed

‎src/Symfony/Component/Validator/Constraints/EmailValidator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/EmailValidator.php
+2-10Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,7 @@ public function validate($value, Constraint $constraint)
138138
*/
139139
private function checkMX($host)
140140
{
141-
if ('' === $host) {
142-
return false;
143-
}
144-
145-
return checkdnsrr($host, 'MX');
141+
return ('' !== $host) && checkdnsrr($host, 'MX');
146142
}
147143

148144
/**
@@ -154,10 +150,6 @@ private function checkMX($host)
154150
*/
155151
private function checkHost($host)
156152
{
157-
if ('' === $host) {
158-
return false;
159-
}
160-
161-
return $this->checkMX($host) || (checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA'));
153+
return ('' !== $host) && ($this->checkMX($host) || (checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA')));
162154
}
163155
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.