Completed
Push — master ( 6dd3a0...ec39b9 )
by Níckolas Daniel
05:32
created

RulesSet::addAllowRules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace PODEntender\Domain\Model\FileProcessing\RobotsTxt;
4
5
class RulesSet
6
{
7
    private $userAgent;
8
    private $disallowRules = [];
9
    private $allowRules = [];
10
11
    public function __construct(string $userAgent)
12
    {
13
        $this->userAgent = $userAgent;
14
    }
15
16
    public function addDisallowRules(array $rules) : self
17
    {
18
        $this->disallowRules = array_merge($this->disallowRules, $rules);
19
20
        return $this;
21
    }
22
23
    public function addAllowRules(array $rules) : self
24
    {
25
        $this->allowRules = array_merge($this->allowRules, $rules);
26
27
        return $this;
28
    }
29
30
    public function userAgent() : string
31
    {
32
        return $this->userAgent;
33
    }
34
35
    public function disallowRules() : array
36
    {
37
        return $this->disallowRules;
38
    }
39
40
    public function allowRules() : array
41
    {
42
        return $this->allowRules;
43
    }
44
}
45