Completed
Push — master ( 2f6667...a79c5c )
by Mike
11s
created

MigrationsEventArgs::getConnection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/*
3
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * This software consists of voluntary contributions made by many individuals
16
 * and is licensed under the LGPL. For more information, see
17
 * <http://www.doctrine-project.org>.
18
 */
19
20
namespace Doctrine\DBAL\Migrations\Event;
21
22
use Doctrine\Common\EventArgs;
23
use Doctrine\DBAL\Migrations\Configuration\Configuration;
24
25
class MigrationsEventArgs extends EventArgs
26
{
27
    /**
28
     * @var Configuration
29
     */
30
    private $config;
31
32
    /**
33
     * The direction of the migration.
34
     *
35
     * @var string (up|down)
36
     */
37
    private $direction;
38
39
    /**
40
     * Whether or not the migrations are executing in dry run mode.
41
     *
42
     * @var bool
43
     */
44
    private $dryRun;
45
46 48
    public function __construct(Configuration $config, $direction, $dryRun)
47
    {
48 48
        $this->config = $config;
49 48
        $this->direction = $direction;
50 48
        $this->dryRun = (bool) $dryRun;
51 48
    }
52
53
    public function getConfiguration()
54
    {
55
        return $this->config;
56
    }
57
58 4
    public function getConnection()
59
    {
60 4
        return $this->config->getConnection();
61
    }
62
63
    public function getDirection()
64
    {
65
        return $this->direction;
66
    }
67
68 4
    public function isDryRun()
69
    {
70 4
        return $this->dryRun;
71
    }
72
}
73