Failed Conditions
Pull Request — 3.0.x (#3980)
by Guilherme
07:55
created

Statement::bindParam()   A

Complexity

Conditions 4
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 20

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 9
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
cc 4
nc 2
nop 5
crap 20
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
    public function bindParam($column, &$variable, $type = ParameterType::STRING, $length = null, $driverOptions = null)
18
    {
19
        if (($type === ParameterType::LARGE_OBJECT || $type === ParameterType::BINARY)
20
            && $driverOptions === null
21
        ) {
22
            $driverOptions = PDO::SQLSRV_ENCODING_BINARY;
23
        }
24
25
        return parent::bindParam($column, $variable, $type, $length, $driverOptions);
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function bindValue($param, $value, $type = ParameterType::STRING)
32
    {
33
        return $this->bindParam($param, $value, $type);
34
    }
35
}
36