Completed
Push — master ( f02874...421f9f )
by Anton
11s
created

phinx.php ➔ getConfigByEnvironment()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 1
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * @namespace
4
 */
5
namespace Application;
6
7
return [
8
    'paths' => [
9
        'migrations' => '%%PHINX_CONFIG_DIR%%/data/migrations'
10
    ],
11
    'environments' => [
12
        'default_migration_table' => 'migrations',
13
14
        'default' => call_user_func(function () {
15
            $config = new \Bluz\Config\Config();
16
17
            $config ->setPath(PATH_APPLICATION);
18
            $config ->setEnvironment(getenv('BLUZ_ENV') ?? 'production');
19
            $config ->init();
20
21
            $data = $config->getData('db', 'connect');
22
            $data['adapter'] = $data['type'];
23
24
            return $data;
25
        })
26
    ]
27
];
28