RouteConditionHandlerTrait::setPort()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php declare(strict_types=1);
2
3
namespace League\Route;
4
5
trait RouteConditionHandlerTrait
6
{
7
    /**
8
     * @var string|null
9
     */
10
    protected $host;
11
12
    /**
13
     * @var string|null
14
     */
15
    protected $name;
16
17
    /**
18
     * @var string|null
19
     */
20
    protected $scheme;
21
22
    /**
23
     * @var int|null
24
     */
25
    protected $port;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30 45
    public function getHost(): ?string
31
    {
32 45
        return $this->host;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38 9
    public function setHost(string $host): RouteConditionHandlerInterface
39
    {
40 9
        $this->host = $host;
41
42 9
        return $this;
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48 45
    public function getName(): ?string
49
    {
50 45
        return $this->name;
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56 6
    public function setName(string $name): RouteConditionHandlerInterface
57
    {
58 6
        $this->name = $name;
59
60 6
        return $this;
61
    }
62
63
    /**
64
     * {@inheritdoc}
65
     */
66 48
    public function getScheme(): ?string
67
    {
68 48
        return $this->scheme;
69
    }
70
71
    /**
72
     * {@inheritdoc}
73
     */
74 9
    public function setScheme(string $scheme): RouteConditionHandlerInterface
75
    {
76 9
        $this->scheme = $scheme;
77
78 9
        return $this;
79
    }
80
81
    /**
82
     * {@inheritdoc}
83
     */
84 42
    public function getPort(): ?int
85
    {
86 42
        return $this->port;
87
    }
88
89
    /**
90
     * {@inheritdoc}
91
     */
92 9
    public function setPort(int $port): RouteConditionHandlerInterface
93
    {
94 9
        $this->port = $port;
95
96 9
        return $this;
97
    }
98
}
99