Passed
Push — master ( 10a192...087136 )
by Aleksei
07:38 queued 05:42
created

MigrationConfig::getDirectory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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