Passed
Push — master ( e0b1d7...ca5e79 )
by Matthijs
07:20
created

UriDecorator   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 109
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 13
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 109
rs 10

13 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A toString() 0 4 1
A equals() 0 4 1
A normalize() 0 4 1
A __toString() 0 4 1
A getHost() 0 4 1
A getPassword() 0 4 1
A getPath() 0 4 1
A getPort() 0 4 1
A getQuery() 0 4 1
A getScheme() 0 4 1
A getUsername() 0 4 1
A getFragment() 0 4 1
1
<?php
2
3
namespace VDB\Spider\Uri;
4
5
use VDB\Uri\UriInterface;
6
7
abstract class UriDecorator implements UriInterface
8
{
9
    /**
10
     * @var UriInterface
11
     */
12
    protected $decorated;
13
14
    public function __construct(UriInterface $decorated)
15
    {
16
        $this->decorated = $decorated;
17
    }
18
19
    public function toString()
20
    {
21
        return $this->decorated->toString();
22
    }
23
24
    /**
25
     * @param UriInterface $that
26
     * @param boolean $normalized whether to compare normalized versions of the URIs
27
     * @return boolean
28
     */
29
    public function equals(UriInterface $that, $normalized = false)
30
    {
31
        return $this->decorated->equals($that, $normalized);
32
    }
33
34
    /**
35
     * @return UriInterface
36
     */
37
    public function normalize()
38
    {
39
        return $this->decorated->normalize();
40
    }
41
42
    /**
43
     * Alias of Uri::toString()
44
     *
45
     * @return string
46
     */
47
    public function __toString()
48
    {
49
        return $this->decorated->__toString();
50
    }
51
52
    /**
53
     * @return string|null
54
     */
55
    public function getHost()
56
    {
57
        return $this->decorated->getHost();
58
    }
59
60
    /**
61
     * @return string|null
62
     */
63
    public function getPassword()
64
    {
65
        return $this->decorated->getPassword();
66
    }
67
68
    /**
69
     * @return string|null
70
     */
71
    public function getPath()
72
    {
73
        return $this->decorated->getPath();
74
    }
75
76
    /**
77
     * @return int|null
78
     */
79
    public function getPort()
80
    {
81
        return $this->decorated->getPort();
82
    }
83
84
    /**
85
     * @return string|null
86
     */
87
    public function getQuery()
88
    {
89
        return $this->decorated->getQuery();
90
    }
91
92
    /**
93
     * @return string|null
94
     */
95
    public function getScheme()
96
    {
97
        return $this->decorated->getScheme();
98
    }
99
100
    /**
101
     * @return string|null
102
     */
103
    public function getUsername()
104
    {
105
        return $this->decorated->getUsername();
106
    }
107
108
    /**
109
     * @return string|null
110
     */
111
    public function getFragment()
112
    {
113
        return $this->decorated->getFragment();
114
    }
115
}
116