DelayCore::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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\Client\Directives;
10
11
use vipnytt\RobotsTxtParser\Client\Delay;
12
13
/**
14
 * Class DelayCore
15
 *
16
 * @package vipnytt\RobotsTxtParser\Client\Directives
17
 */
18
abstract class DelayCore implements DelayInterface, ClientInterface
19
{
20
    /**
21
     * Base uri
22
     * @var string
23
     */
24
    protected $base;
25
26
    /**
27
     * User-agent
28
     * @var string
29
     */
30
    protected $product;
31
32
    /**
33
     * DelayClient constructor.
34
     *
35
     * @param string $baseUri
36
     * @param string $product
37
     */
38
    public function __construct($baseUri, $product)
39
    {
40
        $this->base = $baseUri;
41
        $this->product = $product;
42
    }
43
44
    /**
45
     * Get base uri
46
     *
47
     * @return string
48
     */
49
    public function getBaseUri()
50
    {
51
        return $this->base;
52
    }
53
54
    /**
55
     * Get User-agent string
56
     *
57
     * @return string
58
     */
59
    public function getUserAgent()
60
    {
61
        return $this->product;
62
    }
63
64
    /**
65
     * Handle delay
66
     *
67
     * @param Delay\ManageInterface $handler
68
     * @return Delay\BaseInterface
69
     */
70
    public function handle(Delay\ManageInterface $handler)
71
    {
72
        return $handler->base($this->base, $this->product, $this->getValue());
73
    }
74
}
75