Completed
Branch 2.0-dev (4f313a)
by Jan-Petter
02:57
created

RootDirectiveHandler   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 0
cbo 4
dl 0
loc 79
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A cleanParam() 0 4 1
A host() 0 4 1
A sitemap() 0 4 1
A userAgent() 0 4 1
1
<?php
2
namespace vipnytt\RobotsTxtParser\Parser\Directives;
3
4
use vipnytt\RobotsTxtParser\RobotsTxtInterface;
5
6
/**
7
 * Class RootDirectiveHandler
8
 *
9
 * @package vipnytt\RobotsTxtParser\Parser\Directives
10
 */
11
class RootDirectiveHandler implements RobotsTxtInterface
12
{
13
    /**
14
     * Clean-param
15
     * @var CleanParamParser
16
     */
17
    private $cleanParam;
18
19
    /**
20
     * Host
21
     * @var HostParser
22
     */
23
    private $host;
24
25
    /**
26
     * Sitemap
27
     * @var SitemapParser
28
     */
29
    private $sitemap;
30
31
    /**
32
     * User-agent
33
     * @var UserAgentParser
34
     */
35
    private $userAgent;
36
37
    /**
38
     * RootDirectiveHandler constructor.
39
     *
40
     * @param string $base
41
     */
42
    public function __construct($base)
43
    {
44
        $this->cleanParam = new CleanParamParser();
45
        $this->host = new HostParser();
46
        $this->sitemap = new SitemapParser();
47
        $this->userAgent = new UserAgentParser($base);
48
    }
49
50
    /**
51
     * Clean-param
52
     *
53
     * @return CleanParamParser
54
     */
55
    public function cleanParam()
56
    {
57
        return $this->cleanParam;
58
    }
59
60
    /**
61
     * Host
62
     *
63
     * @return HostParser
64
     */
65
    public function host()
66
    {
67
        return $this->host;
68
    }
69
70
    /**
71
     * Sitemap
72
     *
73
     * @return SitemapParser
74
     */
75
    public function sitemap()
76
    {
77
        return $this->sitemap;
78
    }
79
80
    /**
81
     * User-agent
82
     *
83
     * @return UserAgentParser
84
     */
85
    public function userAgent()
86
    {
87
        return $this->userAgent;
88
    }
89
}
90