Failed Conditions
Push — master ( 379085...b45ed5 )
by Marco
54s queued 28s
created

Driver::createDatabasePlatformForVersion()   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

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Doctrine\DBAL\Driver\DrizzlePDOMySql;
4
5
use Doctrine\DBAL\Platforms\DrizzlePlatform;
6
use Doctrine\DBAL\Schema\DrizzleSchemaManager;
7
8
/**
9
 * Drizzle driver using PDO MySql.
10
 */
11
class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function connect(array $params, $username = null, $password = null, array $driverOptions = [])
17
    {
18
        return new Connection(
19
            $this->constructPdoDsn($params),
20
            $username,
21
            $password,
22
            $driverOptions
23
        );
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 19
    public function createDatabasePlatformForVersion($version)
30
    {
31 19
        return $this->getDatabasePlatform();
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37 38
    public function getDatabasePlatform()
38
    {
39 38
        return new DrizzlePlatform();
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45 19
    public function getSchemaManager(\Doctrine\DBAL\Connection $conn)
46
    {
47 19
        return new DrizzleSchemaManager($conn);
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53 19
    public function getName()
54
    {
55 19
        return 'drizzle_pdo_mysql';
56
    }
57
}
58