Completed
Push — master ( 77e4e4...2e1347 )
by Beniamin
05:23
created

PDOStatement   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 43
wmc 4
lcom 1
cbo 0
ccs 11
cts 11
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A bindValue() 0 6 1
A execute() 0 6 1
A fetchScalar() 0 4 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\QueryBuilder\Statement;
13
14
/**
15
 * @author Beniamin Jonatan Šimko <[email protected]>
16
 */
17
class PDOStatement implements StatementInterface
18
{
19
    /**
20
     * @var \PDOStatement $wrappedStatement
21
     */
22
    private $wrappedStatement;
23
24
    /**
25
     * @param \PDOStatement $statement
26
     */
27 1
    public function __construct(\PDOStatement $statement)
28
    {
29 1
        $this->wrappedStatement = $statement;
30 1
    }
31
32
    /**
33
     * @inheritdoc
34
     */
35 1
    public function bindValue($parameter, $value)
36
    {
37 1
        $this->wrappedStatement->bindValue($parameter, $value);
38
39 1
        return $this;
40
    }
41
42
    /**
43
     * @inheritdoc
44
     */
45 1
    public function execute()
46
    {
47 1
        $this->wrappedStatement->execute();
48
49 1
        return $this;
50
    }
51
52
    /**
53
     * @inheritdoc
54
     */
55 1
    public function fetchScalar()
56
    {
57 1
        return $this->wrappedStatement->fetch(\PDO::FETCH_COLUMN);
58
    }
59
}