Completed
Push — develop ( 72ba3e...de019a )
by Marco
25s queued 12s
created

Statement::bindValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1.037

Importance

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