Completed
Push — master ( fb8d74...ff1e54 )
by Sébastien
02:09
created

PdoSqliteConnection::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4286
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Soluble\DbWrapper\Connection;
4
5
use Soluble\DbWrapper\Adapter\AdapterInterface;
6
use PDO;
7
8
class PdoSqliteConnection implements ConnectionInterface
9
{
10
11
    /**
12
     *
13
     * @var AdapterInterface
14
     */
15
    protected $adapter;
16
17
18
    /**
19
     *
20
     * @var \PDO
21
     */
22
    protected $resource;
23
24
    /**
25
     *
26
     * @param AdapterInterface $adapter
27
     * @param \PDO $resource
28
     */
29 7
    public function __construct(AdapterInterface $adapter, PDO $resource)
30
    {
31 7
        $this->adapter = $adapter;
32 7
        $this->resource = $resource;
33 7
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38 1
    public function getCurrentSchema()
39
    {
40 1
        return "main";
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     * @return \PDO
46
     */
47 1
    public function getResource()
48
    {
49 1
        return $this->resource;
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55 1
    public function getHost()
56
    {
57 1
        return "localhost";
58
    }
59
}
60