Passed
Pull Request — dev (#47)
by Stone
04:17 queued 01:57
created

SiteConfig   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSiteConfig() 0 10 2
1
<?php
2
3
namespace App\Modules;
4
5
use Core\Modules\Module;
6
use App\Models\ConfigModel;
7
8
class SiteConfig extends Module
9
{
10
    /**
11
     * Gets the entire site configuration and arranges it into a displayable list
12
     * @return array the config ordered and ready to display
13
     */
14
    public function getSiteConfig()
15
    {
16
17
        $configs = new ConfigModel($this->container);
18
        $siteConfig = $configs->getAllConfig();
19
        $data = [];
20
        foreach ($siteConfig as $config) {
21
            $data[$config->configs_name] = $config->configs_value;
22
        }
23
        return $data;
24
    }
25
}