Failed Conditions
Push — master ( 4252f4...9d8e13 )
by Adrien
07:13
created

EmailType::parseLiteral()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
cc 3
eloc 5
nc 3
nop 2
dl 0
loc 12
ccs 0
cts 6
cp 0
crap 12
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Api\Scalar;
6
7
class EmailType extends AbstractStringBasedType
8
{
9
    /**
10
     * Validate a email
11
     *
12
     * @param mixed $value
13
     *
14
     * @return bool
15
     */
16 3
    protected function isValid($value): bool
17
    {
18 3
        return is_string($value) && filter_var($value, FILTER_VALIDATE_EMAIL);
19
    }
20
}
21