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

RulesSet   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 6
eloc 12
dl 0
loc 38
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A addDisallowRules() 0 5 1
A addAllowRules() 0 5 1
A __construct() 0 3 1
A allowRules() 0 3 1
A disallowRules() 0 3 1
A userAgent() 0 3 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