MigrationConfig::isSafe()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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