Migration   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 34
ccs 0
cts 9
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getConfig() 0 4 1
1
<?php namespace Arcanesoft\Tracker\Bases;
2
3
use Arcanedev\Support\Bases\Migration as BaseMigration;
4
5
/**
6
 * Class     Migration
7
 *
8
 * @package  Arcanesoft\Tracker\Bases
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
abstract class Migration extends BaseMigration
12
{
13
    /* -----------------------------------------------------------------
14
     |  Constructor
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * Migration constructor.
20
     */
21
    public function __construct()
22
    {
23
        $this->setConnection($this->getConfig('database.connection', null));
24
        $this->setPrefix($this->getConfig('database.prefix', 'tracker_'));
25
    }
26
27
    /* -----------------------------------------------------------------
28
     |  Other Methods
29
     | -----------------------------------------------------------------
30
     */
31
32
    /**
33
     * Get a value from config.
34
     *
35
     * @param  string      $key
36
     * @param  mixed|null  $default
37
     *
38
     * @return mixed
39
     */
40
    protected function getConfig($key, $default = null)
41
    {
42
        return config("arcanesoft.tracker.$key", $default);
43
    }
44
}
45