Completed
Pull Request — master (#48)
by Shawn
05:13 queued 02:49
created

DBConfigs::execute()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 6
nc 3
nop 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: sdibble
5
 * Date: 12/7/2016
6
 * Time: 2:17 PM.
7
 */
8
9
namespace SET\Handlers\DBConfigs;
10
11
use Illuminate\Support\Facades\Schema;
12
use SET\Setting;
13
14
/**
15
 * Class DBConfigs.
16
 */
17
class DBConfigs
18
{
19
    /**
20
     * @var array
21
     */
22
    protected static $classes = [
23
        Ldap::class,
24
        Mail::class,
25
    ];
26
27
    /**
28
     *  Cycle through our classes and setup configuration data for each.
29
     */
30
    public static function execute()
31
    {
32
        if (!Schema::hasTable('settings')) {
33
            return;
34
        }
35
        $settings = Setting::getAll();
36
        foreach (static::$classes as $class) {
37
            (new $class($settings))->setup();
38
        }
39
    }
40
}
41