Passed
Push — exceptions ( 722472 )
by Michael
15:25
created

Statement::bindParam()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3.3332

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 6
cp 0.6667
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 3
nc 2
nop 5
crap 3.3332
1
<?php
2
3
namespace Doctrine\DBAL\Driver\PDOSqlsrv;
4
5
use Doctrine\DBAL\Driver\PDOStatement;
6
use Doctrine\DBAL\ParameterType;
7
use PDO;
8
9
/**
10
 * PDO SQL Server Statement
11
 */
12
class Statement extends PDOStatement
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17 37
    public function bindParam($column, &$variable, $type = ParameterType::STRING, $length = null, $driverOptions = null)
18
    {
19 37
        if ($type === ParameterType::LARGE_OBJECT && $driverOptions === null) {
20 1
            $driverOptions = PDO::SQLSRV_ENCODING_BINARY;
21
        }
22
23 37
        return parent::bindParam($column, $variable, $type, $length, $driverOptions);
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 30
    public function bindValue($param, $value, $type = ParameterType::STRING)
30
    {
31 30
        return $this->bindParam($param, $value, $type);
32
    }
33
}
34