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

EmailType::serialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
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