BaseCore   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 46
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 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
use vipnytt\RobotsTxtParser\Handler\DatabaseTrait;
12
use vipnytt\RobotsTxtParser\Parser\UriParser;
13
14
/**
15
 * Class BaseCore
16
 *
17
 * @package vipnytt\RobotsTxtParser\Client\Cache
18
 */
19
abstract class BaseCore implements BaseInterface
20
{
21
    use DatabaseTrait;
22
23
    /**
24
     * Database handler
25
     * @var \PDO
26
     */
27
    protected $pdo;
28
29
    /**
30
     * Base uri
31
     * @var string
32
     */
33
    protected $base;
34
35
    /**
36
     * cURL options
37
     * @var array
38
     */
39
    protected $curlOptions;
40
41
    /**
42
     * Byte limit
43
     * @var int|null
44
     */
45
    protected $byteLimit;
46
47
    /**
48
     * ClientCore constructor.
49
     *
50
     * @param \PDO $pdo
51
     * @param string $baseUri
52
     * @param array $curlOptions
53
     * @param int|null $byteLimit
54
     */
55
    public function __construct(\PDO $pdo, $baseUri, array $curlOptions, $byteLimit)
56
    {
57
        $uriParser = new UriParser($baseUri);
58
        $this->base = $uriParser->base();
59
        $this->pdo = $pdo;
60
        $this->curlOptions = $curlOptions;
61
        $this->byteLimit = $byteLimit;
62
63
    }
64
}
65