RouteConditionHandlerTrait   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 118
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 0
dl 0
loc 118
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getHost() 0 4 1
A setHost() 0 6 1
A getName() 0 4 1
A setName() 0 6 1
A getScheme() 0 4 1
A setScheme() 0 6 1
A getPort() 0 4 1
A setPort() 0 6 1
1
<?php declare(strict_types=1);
2
3
namespace League\Route;
4
5
trait RouteConditionHandlerTrait
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $host;
11
12
    /**
13
     * @var string
14
     */
15
    protected $name;
16
17
    /**
18
     * @var string
19
     */
20
    protected $scheme;
21
22
    /**
23
     * @var int
24
     */
25
    protected $port;
26
27
    /**
28
     * Get the host.
29
     *
30
     * @return string
31
     */
32 26
    public function getHost() : ?string
33
    {
34 26
        return $this->host;
35
    }
36
37
    /**
38
     * Set the host.
39
     *
40
     * @param string $host
41
     *
42
     * @return \League\Route\RouteConditionHandlerInterface
43
     */
44 6
    public function setHost(string $host) : RouteConditionHandlerInterface
45
    {
46 6
        $this->host = $host;
47
48 6
        return $this;
49
    }
50
51
    /**
52
     * Get the name.
53
     *
54
     * @return string
55
     */
56 26
    public function getName() : ?string
57
    {
58 26
        return $this->name;
59
    }
60
61
    /**
62
     * Set the name.
63
     *
64
     * @param string $name
65
     *
66
     * @return \League\Route\RouteConditionHandlerInterface
67
     */
68 4
    public function setName(string $name) : RouteConditionHandlerInterface
69
    {
70 4
        $this->name = $name;
71
72 4
        return $this;
73
    }
74
75
    /**
76
     * Get the scheme.
77
     *
78
     * @return string
79
     */
80 28
    public function getScheme() : ?string
81
    {
82 28
        return $this->scheme;
83
    }
84
85
    /**
86
     * Set the scheme.
87
     *
88
     * @param string $scheme
89
     *
90
     * @return \League\Route\RouteConditionHandlerInterface
91
     */
92 6
    public function setScheme(string $scheme) : RouteConditionHandlerInterface
93
    {
94 6
        $this->scheme = $scheme;
95
96 6
        return $this;
97
    }
98
99
    /**
100
     * Get the port.
101
     *
102
     * @return int
103
     */
104 24
    public function getPort() : ?int
105
    {
106 24
        return $this->port;
107
    }
108
109
    /**
110
     * Set the port.
111
     *
112
     * @param int $port
113
     *
114
     * @return \League\Route\RouteConditionHandlerInterface
115
     */
116 6
    public function setPort(int $port) : RouteConditionHandlerInterface
117
    {
118 6
        $this->port = $port;
119
120 6
        return $this;
121
    }
122
}
123