Completed
Pull Request — develop (#3569)
by Jonathan
22:31 queued 18:18
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
declare(strict_types=1);
4
5
namespace Doctrine\DBAL\Driver\PDOSqlsrv;
6
7
use Doctrine\DBAL\Driver\PDOStatement;
8
use Doctrine\DBAL\ParameterType;
9
use PDO;
10
11
/**
12
 * PDO SQL Server Statement
13
 */
14
class Statement extends PDOStatement
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19 58
    public function bindParam($param, &$variable, int $type = ParameterType::STRING, ?int $length = null, $driverOptions = null) : void
20
    {
21 58
        if (($type === ParameterType::LARGE_OBJECT || $type === ParameterType::BINARY)
22 58
            && $driverOptions === null
23
        ) {
24 58
            $driverOptions = PDO::SQLSRV_ENCODING_BINARY;
25
        }
26
27 58
        parent::bindParam($param, $variable, $type, $length, $driverOptions);
28 58
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33 58
    public function bindValue($param, $value, int $type = ParameterType::STRING) : void
34
    {
35 58
        $this->bindParam($param, $value, $type);
36 58
    }
37
}
38