PDOConnection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 5
c 1
b 0
f 1
dl 0
loc 23
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A requiresQueryForServerVersion() 0 3 1
1
<?php
2
/**
3
 * Licensed to CRATE Technology GmbH("Crate") under one or more contributor
4
 * license agreements.  See the NOTICE file distributed with this work for
5
 * additional information regarding copyright ownership.  Crate licenses
6
 * this file to you under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.  You may
8
 * obtain a copy of the License at
9
 *
10
 * http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
15
 * License for the specific language governing permissions and limitations
16
 * under the License.
17
 *
18
 * However, if you have executed another commercial license agreement
19
 * with Crate these terms will supersede the license and you may use the
20
 * software solely pursuant to the terms of the relevant commercial agreement.
21
 */
22
23
namespace Crate\DBAL\Driver\PDOCrate;
24
25
use Crate\PDO\PDO;
26
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
27
28
class PDOConnection extends PDO implements ServerInfoAwareConnection
0 ignored issues
show
Deprecated Code introduced by
The class Crate\PDO\PDO has been deprecated: The API interface `Crate\PDO\PDO` is deprecated and will be removed on one of the upcoming releases. Please use `Crate\PDO\PDOCrateDB` instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

28
class PDOConnection extends /** @scrutinizer ignore-deprecated */ PDO implements ServerInfoAwareConnection
Loading history...
29
{
30
    /**
31
     * @param string $dsn
32
     * @param string $user
33
     * @param string $password
34
     * @param array $options
35
     */
36 12
    public function __construct($dsn, $user = null, $password = null, array $options = null)
37
    {
38 12
        parent::__construct($dsn, $user, $password, $options);
39 12
        $this->setAttribute(PDO::ATTR_STATEMENT_CLASS, CrateStatement::class);
40 12
        $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
41
    }
42
43
    /**
44
     * Checks whether a query is required to retrieve the database server version.
45
     *
46
     * @return boolean True if a query is required to retrieve the database server version, false otherwise.
47
     */
48 6
    public function requiresQueryForServerVersion()
49
    {
50 6
        return false;
51
    }
52
}
53