Failed Conditions
Pull Request — master (#2836)
by
unknown
14:05
created

ConnectionEventArgs::getDriver()   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 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Doctrine\DBAL\Event;
4
5
use Doctrine\Common\EventArgs;
6
use Doctrine\DBAL\Connection;
7
use Doctrine\DBAL\Driver;
8
use Doctrine\DBAL\Platforms\AbstractPlatform;
9
use Doctrine\DBAL\Schema\AbstractSchemaManager;
10
11
/**
12
 * Event Arguments used when a Driver connection is established inside Doctrine\DBAL\Connection.
13
 */
14
class ConnectionEventArgs extends EventArgs
15
{
16
    /** @var Connection */
17
    private $connection;
18
19 324
    public function __construct(Connection $connection)
20
    {
21 324
        $this->connection = $connection;
22 324
    }
23
24
    /**
25
     * @return Connection
26
     */
27 296
    public function getConnection()
28
    {
29 296
        return $this->connection;
30
    }
31
32
    /**
33
     * @return Driver
34
     */
35
    public function getDriver()
36
    {
37
        return $this->connection->getDriver();
38
    }
39
40
    /**
41
     * @return AbstractPlatform
42
     */
43 28
    public function getDatabasePlatform()
44
    {
45 28
        return $this->connection->getDatabasePlatform();
46
    }
47
48
    /**
49
     * @return AbstractSchemaManager
50
     */
51
    public function getSchemaManager()
52
    {
53
        return $this->connection->getSchemaManager();
54
    }
55
}
56