Skip to content

Commit 01a69b9

Browse files
apetitpafabpot
authored andcommitted
Move empty condition in return statement
1 parent 495774f commit 01a69b9

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

Constraints/EmailValidator.php

Lines 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)