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

DBConfigs   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 10 3
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