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

ConnectionEventArgs   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 63.64%

Importance

Changes 0
Metric Value
wmc 5
eloc 7
c 0
b 0
f 0
dl 0
loc 40
ccs 7
cts 11
cp 0.6364
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getDriver() 0 3 1
A getConnection() 0 3 1
A getSchemaManager() 0 3 1
A getDatabasePlatform() 0 3 1
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