Completed
Pull Request — master (#919)
by Asmir
02:24
created

MigratorConfiguration   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 21
dl 0
loc 75
ccs 25
cts 25
cp 1
rs 10
c 0
b 0
f 0
wmc 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getTimeAllQueries() 0 3 1
A setTimeAllQueries() 0 5 1
A isDryRun() 0 3 1
A getNoMigrationException() 0 3 1
A setDryRun() 0 5 1
A setFromSchema() 0 5 1
A setAllOrNothing() 0 5 1
A getFromSchema() 0 3 1
A setNoMigrationException() 0 5 1
A isAllOrNothing() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Migrations;
6
7
use Doctrine\DBAL\Schema\Schema;
8
9
/**
10
 * The MigratorConfiguration class is responsible for defining the configuration for a migration.
11
 *
12
 * @internal
13
 *
14
 * @see Doctrine\Migrations\DbalMigrator
15
 * @see Doctrine\Migrations\Version\DbalExecutor
16
 */
17
class MigratorConfiguration
18
{
19
    /** @var bool */
20
    private $dryRun = false;
21
22
    /** @var bool */
23
    private $timeAllQueries = false;
24
25
    /** @var bool */
26
    private $noMigrationException = false;
27
28
    /** @var bool */
29
    private $allOrNothing = false;
30
31
    /** @var Schema|null */
32
    private $fromSchema;
33
34 27
    public function isDryRun() : bool
35
    {
36 27
        return $this->dryRun;
37
    }
38
39 19
    public function setDryRun(bool $dryRun) : self
40
    {
41 19
        $this->dryRun = $dryRun;
42
43 19
        return $this;
44
    }
45
46 10
    public function getTimeAllQueries() : bool
47
    {
48 10
        return $this->timeAllQueries;
49
    }
50
51 25
    public function setTimeAllQueries(bool $timeAllQueries) : self
52
    {
53 25
        $this->timeAllQueries = $timeAllQueries;
54
55 25
        return $this;
56
    }
57
58 1
    public function getNoMigrationException() : bool
59
    {
60 1
        return $this->noMigrationException;
61
    }
62
63 1
    public function setNoMigrationException(bool $noMigrationException = false) : self
64
    {
65 1
        $this->noMigrationException = $noMigrationException;
66
67 1
        return $this;
68
    }
69
70 5
    public function isAllOrNothing() : bool
71
    {
72 5
        return $this->allOrNothing;
73
    }
74
75 17
    public function setAllOrNothing(bool $allOrNothing) : self
76
    {
77 17
        $this->allOrNothing = $allOrNothing;
78
79 17
        return $this;
80
    }
81
82 1
    public function getFromSchema() : ?Schema
83
    {
84 1
        return $this->fromSchema;
85
    }
86
87 2
    public function setFromSchema(Schema $fromSchema) : self
88
    {
89 2
        $this->fromSchema = $fromSchema;
90
91 2
        return $this;
92
    }
93
}
94