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

Group   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
dl 0
loc 73
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setHost() 0 4 1
A getProtocol() 0 3 1
A getHost() 0 3 1
A setProtocol() 0 4 1
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