Test Failed
Push — master ( 38c078...235f8a )
by Mike
05:57
created

DatabaseConfig   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 62
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getPropelConfig() 0 3 1
A getPropelCommand() 0 3 1
A getSchemaPaths() 0 3 1
A getConfDir() 0 3 1
A getSchemaTarget() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
5
namespace Xervice\Database;
6
7
8
use Xervice\Core\Config\AbstractConfig;
9
10
class DatabaseConfig extends AbstractConfig
11
{
12
    public const PROPEL = 'propel';
13
14
    public const PROPEL_CONF_DIR = 'propel.conf.dir';
15
16
    public const PROPEL_CONF_ADAPTER = 'propel.conf.adapter';
17
18
    public const PROPEL_CONF_HOST = 'propel.conf.host';
19
20
    public const PROPEL_CONF_PORT = 'propel.conf.port';
21
22
    public const PROPEL_CONF_DBNAME = 'propel.conf.dbname';
23
24
    public const PROPEL_CONF_USER = 'propel.conf.user';
25
26
    public const PROPEL_CONF_PASSWORD = 'propel.conf.password';
27
28
    public const PROPEL_COMMAND = 'propel.command';
29
30
    public const SCHEMA_PATHS = 'propel.schema.path';
31
32
    public const SCHEMA_TARGET = 'propel.schema.target';
33
34
    /**
35
     * @return string
36
     */
37 1
    public function getSchemaTarget(): string
38
    {
39 1
        return $this->get(self::SCHEMA_TARGET, '');
40
    }
41
42
    /**
43
     * @return array
44
     */
45 1
    public function getSchemaPaths(): array
46
    {
47 1
        return $this->get(self::SCHEMA_PATHS, []);
48
    }
49
50
    /**
51
     * @return array
52
     */
53 2
    public function getPropelConfig() : array
54
    {
55 2
        return $this->get(self::PROPEL);
56
    }
57
58
    /**
59
     * @return string
60
     */
61 3
    public function getConfDir() : string
62
    {
63 3
        return $this->get(self::PROPEL_CONF_DIR);
64
    }
65
66
    /**
67
     * @return string
68
     */
69 2
    public function getPropelCommand() : string
70
    {
71 2
        return $this->get(self::PROPEL_COMMAND, 'vendor/bin/propel');
72
    }
73
}
74