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

MigratorConfiguration::setFromSchema()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
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