Completed
Branch 2.0-dev (d250b8)
by Jan-Petter
03:02
created

SQLMaintenance   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 3
dl 0
loc 39
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A cache() 0 4 1
A delay() 0 4 1
1
<?php
2
namespace vipnytt\RobotsTxtParser\Client\SQL;
3
4
use PDO;
5
use vipnytt\RobotsTxtParser\Client\SQL\Cache\CacheMaintenanceSQL;
6
use vipnytt\RobotsTxtParser\Client\SQL\Delay\DelayMaintenanceSQL;
7
8
/**
9
 * Class SQLMaintenance
10
 *
11
 * @package vipnytt\RobotsTxtParser\Client\SQL
12
 */
13
class SQLMaintenance
14
{
15
    use SQLTrait;
16
17
    /**
18
     * @var PDO
19
     */
20
    private $pdo;
21
22
    /**
23
     * Maintenance constructor.
24
     *
25
     * @param PDO $pdo
26
     */
27
    public function __construct(PDO $pdo)
28
    {
29
        $this->pdo = $this->pdoInitialize($pdo);
30
    }
31
32
    /**
33
     * Cache
34
     *
35
     * @return CacheMaintenanceSQL
36
     */
37
    public function cache()
38
    {
39
        return new CacheMaintenanceSQL($this->pdo);
40
    }
41
42
    /**
43
     * Delay
44
     *
45
     * @return DelayMaintenanceSQL
46
     */
47
    public function delay()
48
    {
49
        return new DelayMaintenanceSQL($this->pdo);
50
    }
51
}
52