Email   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 16
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
/**
7
 * Class Email
8
 *
9
 * @package BestServedCold\PhalueObjects\Internet
10
 */
11
final class Email extends ValueObject
12
{
13
    /**
14
     * Email constructor.
15
     *
16
     * @param $value
17
     */
18 1
    public function __construct($value)
19
    {
20 1
        if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {
21 1
            throw new InvalidTypeException($value, [ 'email' ]);
22
        }
23
24 1
        parent::__construct($value);
25 1
    }
26
}
27