MigrationConfig   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 5
eloc 7
dl 0
loc 43
ccs 6
cts 8
cp 0.75
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getDirectory() 0 3 1
A getNamespace() 0 3 1
A getVendorDirectories() 0 3 1
A isSafe() 0 3 1
A getTable() 0 3 1
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