Completed
Push — master ( 1b6d66...884e6a )
by Adam
02:37
created

Email::equals()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php namespace BestServedCold\PhalueObjects\Internet;
2
3
use BestServedCold\PhalueObjects\ValueObject;
4
use BestServedCold\PhalueObjects\Exception\InvalidTypeException;
5
6
final class Email extends ValueObject
7
{
8 1
    public function __construct($value)
9
    {
10 1
        if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {
11 1
            throw new InvalidTypeException($value, [ 'email' ]);
12
        }
13
14 1
        parent::__construct($value);
15 1
    }
16
}
17