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

Email   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 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