Completed
Pull Request — develop (#3524)
by Jonathan
95:41 queued 92:25
created

Statement   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
eloc 6
dl 0
loc 22
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A bindParam() 0 9 4
A bindValue() 0 3 1
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
    public function bindParam($column, &$variable, $type = ParameterType::STRING, $length = null, $driverOptions = null) : void
20
    {
21
        if (($type === ParameterType::LARGE_OBJECT || $type === ParameterType::BINARY)
22
            && $driverOptions === null
23
        ) {
24
            $driverOptions = PDO::SQLSRV_ENCODING_BINARY;
25
        }
26
27
        parent::bindParam($column, $variable, $type, $length, $driverOptions);
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function bindValue($param, $value, $type = ParameterType::STRING) : void
34
    {
35
        $this->bindParam($param, $value, $type);
36
    }
37
}
38