Completed
Pull Request — master (#2)
by Jan-Petter
02:43
created

UserAgentClient::allow()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace vipnytt\RobotsTxtParser\Client\Directives;
3
4
use vipnytt\RobotsTxtParser\Parser\Directives\SubDirectiveHandler;
5
6
/**
7
 * Class UserAgentClient
8
 *
9
 * @package vipnytt\RobotsTxtParser\Client\Directives
10
 */
11
class UserAgentClient extends UserAgentTools
12
{
13
    /**
14
     * UserAgentClient constructor.
15
     *
16
     * @param SubDirectiveHandler $handler
17
     * @param string $baseUri
18
     * @param int|null $statusCode
19
     */
20
    public function __construct(SubDirectiveHandler $handler, $baseUri, $statusCode)
21
    {
22
        parent::__construct($handler, $baseUri, $statusCode);
23
    }
24
25
    /**
26
     * Allow
27
     *
28
     * @return DisAllowClient
29
     */
30
    public function allow()
31
    {
32
        return $this->handler->allow()->client();
33
    }
34
35
    /**
36
     * Cache-delay
37
     *
38
     * @return DelayClient
39
     */
40
    public function cacheDelay()
41
    {
42
        return $this->handler->cacheDelay()->client($this->crawlDelay()->get());
43
    }
44
45
    /**
46
     * Crawl-delay
47
     *
48
     * @return DelayClient
49
     */
50
    public function crawlDelay()
51
    {
52
        return $this->handler->crawlDelay()->client($this->requestRate()->get());
53
    }
54
55
    /**
56
     * RequestClient-rate
57
     *
58
     * @return RequestRateClient
59
     */
60
    public function requestRate()
61
    {
62
        return $this->handler->requestRate()->client();
63
    }
64
65
    /**
66
     * Comment
67
     *
68
     * @return CommentClient
69
     */
70
    public function comment()
71
    {
72
        return $this->handler->comment()->client();
73
    }
74
75
    /**
76
     * Disallow
77
     *
78
     * @return DisAllowClient
79
     */
80
    public function disallow()
81
    {
82
        return $this->handler->disallow()->client();
83
    }
84
85
    /**
86
     * Robot-version
87
     *
88
     * @return RobotVersionClient
89
     */
90
    public function robotVersion()
91
    {
92
        return $this->handler->robotVersion()->client();
93
    }
94
95
    /**
96
     * Visit-time
97
     *
98
     * @return VisitTimeClient
99
     */
100
    public function visitTime()
101
    {
102
        return $this->handler->visitTime()->client();
103
    }
104
}
105