Failed Conditions
Pull Request — master (#632)
by Michael
02:44
created

MigrationsEventArgs   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 69.23%

Importance

Changes 0
Metric Value
dl 0
loc 36
ccs 9
cts 13
cp 0.6923
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfiguration() 0 3 1
A getDirection() 0 3 1
A getConnection() 0 3 1
A isDryRun() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Migrations\Event;
6
7
use Doctrine\Common\EventArgs;
8
use Doctrine\DBAL\Connection;
9
use Doctrine\Migrations\Configuration\Configuration;
10
11
class MigrationsEventArgs extends EventArgs
12
{
13
    /** @var Configuration */
14
    private $config;
15
16
    /** @var string */
17
    private $direction;
18
19
    /** @var bool */
20
    private $dryRun;
21
22 54
    public function __construct(Configuration $config, string $direction, bool $dryRun)
23
    {
24 54
        $this->config    = $config;
25 54
        $this->direction = $direction;
26 54
        $this->dryRun    = $dryRun;
27 54
    }
28
29
    public function getConfiguration() : Configuration
30
    {
31
        return $this->config;
32
    }
33
34 4
    public function getConnection() : Connection
35
    {
36 4
        return $this->config->getConnection();
37
    }
38
39
    public function getDirection() : string
40
    {
41
        return $this->direction;
42
    }
43
44 4
    public function isDryRun() : bool
45
    {
46 4
        return $this->dryRun;
47
    }
48
}
49