Completed
Push — master ( f1bafc...dbcbc1 )
by Sébastien
03:15
created

PdoSqliteAdapter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 33
ccs 0
cts 12
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A getCurrentSchema() 0 4 1
1
<?php
2
3
namespace Soluble\DbWrapper\Adapter;
4
5
use Soluble\DbWrapper\Exception;
6
use Soluble\DbWrapper\Adapter\Pdo\GenericPdo;
7
use PDO;
8
9
class PdoSqliteAdapter extends GenericPdo implements AdapterInterface
10
{
11
12
    /**
13
     *
14
     * @var \PDO
15
     */
16
    protected $resource;
17
18
19
    /**
20
     * Constructor
21
     *
22
     * @throws Exception\InvalidArgumentException
23
     * @param \PDO $connection
24
     */
25
    public function __construct(PDO $connection)
26
    {
27
        if ($connection->getAttribute(\PDO::ATTR_DRIVER_NAME) != 'sqlite') {
28
            $msg = __CLASS__ . " requires pdo connection to be 'sqlite'";
29
            throw new Exception\InvalidArgumentException($msg);
30
        }
31
        $this->resource = $connection;
32
    }
33
    
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getCurrentSchema() 
38
    {
39
        throw new \Exception('nope');
40
    }
41
}
42