Move empty condition in return statement
This commit is contained in:
parent
a090ef855a
commit
4fcb24bacb
@ -138,11 +138,7 @@ class EmailValidator extends ConstraintValidator
|
||||
*/
|
||||
private function checkMX($host)
|
||||
{
|
||||
if ('' === $host) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return checkdnsrr($host, 'MX');
|
||||
return ('' !== $host) && checkdnsrr($host, 'MX');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -154,10 +150,6 @@ class EmailValidator extends ConstraintValidator
|
||||
*/
|
||||
private function checkHost($host)
|
||||
{
|
||||
if ('' === $host) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->checkMX($host) || (checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA'));
|
||||
return ('' !== $host) && ($this->checkMX($host) || (checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA')));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user