Completed
Push — master ( d5cddb...55b940 )
by Ronaldo
01:35
created

Validator::checkMxIsValid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace WSW\Email;
4
5
/**
6
 * Trait Validator
7
 *
8
 * @package WSW\Email
9
 * @author Ronaldo Matos Rodrigues <[email protected]>
10
 */
11
trait Validator
12
{
13
    /**
14
     * @param string $email
15
     *
16
     * @return bool
17
     */
18 9
    protected function emailIsValid($email)
19
    {
20 9
        return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
21
    }
22
23
    /**
24
     * @param string $domain
25
     *
26
     * @return bool
27
     */
28 2
    protected function checkMxIsValid($domain)
29
    {
30 2
        return (bool) checkdnsrr($domain, 'MX');
31
    }
32
}
33