SubDirectiveHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 88
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 6
dl 0
loc 88
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
1
<?php
2
/**
3
 * vipnytt/RobotsTxtParser
4
 *
5
 * @link https://github.com/VIPnytt/RobotsTxtParser
6
 * @license https://github.com/VIPnytt/RobotsTxtParser/blob/master/LICENSE The MIT License (MIT)
7
 */
8
9
namespace vipnytt\RobotsTxtParser\Handler\Directives;
10
11
use vipnytt\RobotsTxtParser\Parser\Directives\AllowParser;
12
use vipnytt\RobotsTxtParser\Parser\Directives\CommentParser;
13
use vipnytt\RobotsTxtParser\Parser\Directives\DelayParser;
14
use vipnytt\RobotsTxtParser\Parser\Directives\RequestRateParser;
15
use vipnytt\RobotsTxtParser\Parser\Directives\RobotVersionParser;
16
use vipnytt\RobotsTxtParser\Parser\Directives\VisitTimeParser;
17
use vipnytt\RobotsTxtParser\RobotsTxtInterface;
18
19
/**
20
 * Class SubDirectiveHandler
21
 *
22
 * @package vipnytt\RobotsTxtParser\Parser\Directives
23
 */
24
class SubDirectiveHandler implements RobotsTxtInterface
25
{
26
    /**
27
     * Rules added count
28
     * @var int
29
     */
30
    public $count = 0;
31
32
    /**
33
     * Rule set group name
34
     * @var string
35
     */
36
    public $group;
37
38
    /**
39
     * Allow
40
     * @var AllowParser
41
     */
42
    public $allow;
43
44
    /**
45
     * Cache-delay
46
     * @var DelayParser
47
     */
48
    public $cacheDelay;
49
50
    /**
51
     * Comment
52
     * @var CommentParser
53
     */
54
    public $comment;
55
56
    /**
57
     * Crawl-delay
58
     * @var DelayParser
59
     */
60
    public $crawlDelay;
61
62
    /**
63
     * Disallow
64
     * @var AllowParser
65
     */
66
    public $disallow;
67
68
    /**
69
     * NoIndex
70
     * @var AllowParser
71
     */
72
    public $noIndex;
73
74
    /**
75
     * Request-rate
76
     * @var RequestRateParser
77
     */
78
    public $requestRate;
79
80
    /**
81
     * Robot-version
82
     * @var RobotVersionParser
83
     */
84
    public $robotVersion;
85
86
    /**
87
     * Visit-time
88
     * @var VisitTimeParser
89
     */
90
    public $visitTime;
91
92
    /**
93
     * SubDirectiveHandler constructor.
94
     *
95
     * @param string $base
96
     * @param string $group
97
     */
98
    public function __construct($base, $group)
99
    {
100
        $this->group = $group;
101
        $this->allow = new AllowParser(self::DIRECTIVE_ALLOW);
102
        $this->cacheDelay = new DelayParser($base, self::DIRECTIVE_CACHE_DELAY);
103
        $this->comment = new CommentParser($this->group);
104
        $this->crawlDelay = new DelayParser($base, self::DIRECTIVE_CRAWL_DELAY);
105
        $this->disallow = new AllowParser(self::DIRECTIVE_DISALLOW);
106
        $this->noIndex = new AllowParser(self::DIRECTIVE_NO_INDEX);
107
        $this->requestRate = new RequestRateParser($base);
108
        $this->robotVersion = new RobotVersionParser();
109
        $this->visitTime = new VisitTimeParser();
110
    }
111
}
112