Passed
Pull Request — master (#3)
by Бабичев
01:48
created

Group::setHost()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Bavix\Router;
4
5
use Bavix\Router\Rules\PatternRule;
6
7
class Group
8
{
9
10
    /**
11
     * @var PatternRule[]
12
     */
13
    protected $resolver = [];
14
15
    /**
16
     * @var string
17
     */
18
    protected $name;
19
20
    /**
21
     * @var string
22
     */
23
    protected $path;
24
25
    /**
26
     * @var string
27
     */
28
    protected $protocol;
29
30
    /**
31
     * @var string
32
     */
33
    protected $host;
34
35
    /**
36
     * Group constructor.
37
     * @param null|string $path
38
     * @param null|string $name
39
     */
40
    public function __construct(?string $path, ?string $name)
41
    {
42
        $this->path = $path;
43
        $this->name = $name;
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function getProtocol(): string
50
    {
51
        return $this->protocol;
52
    }
53
54
    /**
55
     * @param string $protocol
56
     * @return $this
57
     */
58
    public function setProtocol(string $protocol): self
59
    {
60
        $this->protocol = $protocol;
61
        return $this;
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public function getHost(): string
68
    {
69
        return $this->host;
70
    }
71
72
    /**
73
     * @param string $host
74
     * @return $this
75
     */
76
    public function setHost(string $host): self
77
    {
78
        $this->host = $host;
79
        return $this;
80
    }
81
82
}
83