Passed
Push — deprecation/Type-__toString ( 7454e6 )
by Michael
56:58 queued 42:22
created

Statement::bindValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 3
crap 2
1
<?php
2
/*
3
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * This software consists of voluntary contributions made by many individuals
16
 * and is licensed under the MIT license. For more information, see
17
 * <http://www.doctrine-project.org>.
18
 */
19
20
namespace Doctrine\DBAL\Driver\PDOSqlsrv;
21
22
use Doctrine\DBAL\Driver\PDOStatement;
23
use Doctrine\DBAL\ParameterType;
24
use PDO;
25
26
/**
27
 * PDO SQL Server Statement
28
 */
29
class Statement extends PDOStatement
30
{
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function bindParam($column, &$variable, $type = ParameterType::STRING, $length = null, $driverOptions = null)
35
    {
36
        if (($type === ParameterType::LARGE_OBJECT || $type === ParameterType::BINARY)
37
            && $driverOptions === null
38
        ) {
39
            $driverOptions = PDO::SQLSRV_ENCODING_BINARY;
40
        }
41
42
        return parent::bindParam($column, $variable, $type, $length, $driverOptions);
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public function bindValue($param, $value, $type = ParameterType::STRING)
49
    {
50
        return $this->bindParam($param, $value, $type);
51
    }
52
}
53