Completed
Push — 16146-settings-to-admin ( e90069 )
by Shawn
05:56
created

DBConfigs::execute()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 3
eloc 5
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
 * @package SET\Handlers\DBConfigs
17
 */
18
class DBConfigs
19
{
20
21
    /**
22
     * @var array
23
     */
24
    protected static $classes = [
25
        Ldap::class,
26
        Mail::class,
27
    ];
28
29
    /**
30
     *  Cycle through our classes and setup configuration data for each.
31
     */
32
    public static function execute()
33
    {
34
        if (!Schema::hasTable('settings')) return;
35
        $settings = Setting::getAll();
36
        foreach (static::$classes as $class)
37
        {
38
            (new $class($settings))->setup();
39
        }
40
    }
41
}