Completed
Branch feature/pre-split (67216b)
by Anton
03:22
created

MigrationsConfig::isSafe()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Spiral Framework.
4
 *
5
 * @license MIT
6
 * @author  Anton Titov (Wolfy-J)
7
 */
8
namespace Spiral\Migrations\Configs;
9
10
use Spiral\Core\InjectableConfig;
11
12
class MigrationsConfig extends InjectableConfig
13
{
14
    /**
15
     * Configuration section.
16
     */
17
    const CONFIG = 'migrations';
18
19
    /**
20
     * @var array
21
     */
22
    protected $config = [
23
        'directory' => '',
24
        'database'  => 'default',
25
        'table'     => 'migrations',
26
        'safe'      => false
27
    ];
28
29
    /**
30
     * Migrations directory.
31
     *
32
     * @return string
33
     */
34
    public function getDirectory(): string
35
    {
36
        return $this->config['directory'];
37
    }
38
39
    /**
40
     * Database to store information about executed migration.
41
     *
42
     * @return string
43
     */
44
    public function getDatabase(): string
45
    {
46
        return $this->config['database'];
47
    }
48
49
    /**
50
     * Table to store list of executed migrations.
51
     *
52
     * @return string
53
     */
54
    public function getTable(): string
55
    {
56
        return $this->config['table'];
57
    }
58
59
    /**
60
     * Is it safe to run migration without user confirmation? Attention, this option does not
61
     * used in component directly and left for component consumers.
62
     *
63
     * @return bool
64
     */
65
    public function isSafe(): bool
66
    {
67
        return $this->config['safe'];
68
    }
69
}