Hostname   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
1
<?php
2
3
namespace ValueObjects\Web;
4
5
use ValueObjects\Exception\InvalidNativeArgumentException;
6
use Zend\Validator\Hostname as Validator;
7
8
class Hostname extends Domain
9
{
10
    /**
11
     * Returns a Hostname
12
     *
13
     * @param string $value
14
     */
15 16
    public function __construct($value)
16
    {
17 16
        $validator = new Validator(array('allow' => Validator::ALLOW_DNS | Validator::ALLOW_LOCAL));
18
19 16
        if (false === $validator->isValid($value)) {
20 1
            throw new InvalidNativeArgumentException($value, array('string (valid hostname)'));
21
        }
22
23 15
        $this->value = $value;
24 15
    }
25
}
26