Completed
Push — master ( b54f87...bde51f )
by Beniamin
04:50
created

PDOConnection::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
/**
4
 * This file is part of Phuria SQL Builder 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\SQLBuilder\Connection;
13
14
use Phuria\SQLBuilder\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 4
    public function __construct(\PDO $connection)
30
    {
31 4
        $this->wrappedConnection = $connection;
32 4
    }
33
34
    /**
35
     * @inheritdoc
36
     */
37
    public function query($SQL)
38
    {
39
        $stmt = $this->wrappedConnection->query($SQL);
0 ignored issues
show
Coding Style introduced by
$SQL does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
40
41
        return new PDOStatement($stmt);
42
    }
43
44
    /**
45
     * @inheritdoc
46
     */
47 4
    public function prepare($SQL)
48
    {
49 4
        $stmt = $this->wrappedConnection->prepare($SQL);
0 ignored issues
show
Coding Style introduced by
$SQL does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
50
51 4
        return new PDOStatement($stmt);
52
    }
53
}