Path   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 3
1
<?php
2
3
namespace ValueObjects\Web;
4
5
use ValueObjects\Exception\InvalidNativeArgumentException;
6
use ValueObjects\StringLiteral\StringLiteral;
7
8
class Path extends StringLiteral
9
{
10 15
    public function __construct($value)
11
    {
12 15
        $filteredValue = parse_url($value, PHP_URL_PATH);
13
14 15
        if (null === $filteredValue || strlen($filteredValue) != strlen($value)) {
15 1
            throw new InvalidNativeArgumentException($value, array('string (valid url path)'));
16
        }
17
18 14
        $this->value = $filteredValue;
19 14
    }
20
}
21