ManageCore::setCurlOptions()   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 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\Client\Cache;
10
11
/**
12
 * Class ManageCore
13
 *
14
 * @see https://github.com/VIPnytt/RobotsTxtParser/blob/master/docs/methods/Cache.md for documentation
15
 * @package vipnytt\RobotsTxtParser\Handler\Cache
16
 */
17
abstract class ManageCore implements ManageInterface
18
{
19
    /**
20
     * Database handler
21
     * @var \PDO
22
     */
23
    protected $pdo;
24
25
    /**
26
     * cURL options array
27
     * @var array
28
     */
29
    protected $curlOptions = [];
30
31
    /**
32
     * robots.txt size limit in byte
33
     * @var int
34
     */
35
    protected $byteLimit = self::BYTE_LIMIT;
36
37
    /**
38
     * ManageCore constructor.
39
     *
40
     * @param \PDO $pdo
41
     */
42
    public function __construct(\PDO $pdo)
43
    {
44
        $this->pdo = $pdo;
45
    }
46
47
    /**
48
     * Set byte limit
49
     *
50
     * @param int|null $bytes
51
     * @return bool
52
     */
53
    public function setByteLimit($bytes = self::BYTE_LIMIT)
54
    {
55
        $this->byteLimit = $bytes;
56
        return true;
57
    }
58
59
    /**
60
     * Set cURL options
61
     *
62
     * @param array $options
63
     * @return bool
64
     */
65
    public function setCurlOptions(array $options = self::CURL_OPTIONS)
66
    {
67
        $this->curlOptions = $options;
68
        return true;
69
    }
70
}
71