DelayClient::export()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
/**
12
 * Class DelayClient
13
 *
14
 * @see https://github.com/VIPnytt/RobotsTxtParser/blob/master/docs/methods/DelayClient.md for documentation
15
 * @package vipnytt\RobotsTxtParser\Client\Directives
16
 */
17
class DelayClient extends DelayCore
18
{
19
    /**
20
     * Value
21
     * @var float|int
22
     */
23
    private $value;
24
25
    /**
26
     * Export value
27
     * @var float|int
28
     */
29
    private $exportValue;
30
31
    /**
32
     * DelayClient constructor.
33
     *
34
     * @param string $baseUri
35
     * @param string $product
36
     * @param float|int $value
37
     * @param float|int $fallbackValue
38
     */
39
    public function __construct($baseUri, $product, $value, $fallbackValue = 0)
40
    {
41
        parent::__construct($baseUri, $product);
42
        $this->exportValue = $value;
43
        $this->value = $value > 0 ? $value : $fallbackValue;
44
    }
45
46
    /**
47
     * Get value
48
     *
49
     * @return float|int
50
     */
51
    public function getValue()
52
    {
53
        return $this->value;
54
    }
55
56
    /**
57
     * Export
58
     *
59
     * @return float|int
60
     */
61
    public function export()
62
    {
63
        return $this->exportValue;
64
    }
65
}
66