Completed
Push — master ( 7aa5ea...c891e1 )
by Beniamin
08:55
created

PDOConnection::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
/**
4
 * This file is part of UnderQuery package.
5
 *
6
 * Copyright (c) 2016 Beniamin Jonatan Šimko
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Phuria\UnderQuery\Connection;
13
14
use Phuria\UnderQuery\Statement\PDOStatement;
15
16
/**
17
 * @author Beniamin Jonatan Šimko <[email protected]>
18
 */
19
class PDOConnection implements ConnectionInterface
20
{
21
    /**
22
     * @var \PDO $wrappedConnection
23
     */
24
    private $wrappedConnection;
25
26
    /**
27
     * @param \PDO $connection
28
     */
29 1
    public function __construct(\PDO $connection)
30
    {
31 1
        $this->wrappedConnection = $connection;
32 1
    }
33
34
    /**
35
     * @return \PDO
36
     */
37
    public function getWrappedConnection()
38
    {
39
        return $this->wrappedConnection;
40
    }
41
42
    /**
43
     * @inheritdoc
44
     */
45 1
    public function prepareStatement($SQL)
46
    {
47 1
        $stmt = $this->wrappedConnection->prepare($SQL);
48
49 1
        return new PDOStatement($stmt);
50
    }
51
}