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

PDOConnection   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
dl 0
loc 35
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1
ccs 6
cts 9
cp 0.6667
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A query() 0 6 1
A prepare() 0 6 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
}