Passed
Pull Request — dev (#47)
by Stone
04:18 queued 02:10
created

SiteConfig   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

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
     * @throws \ReflectionException
14
     */
15
    public function getSiteConfig()
16
    {
17
18
        $configs = new ConfigModel($this->container);
19
        $siteConfig = $configs->getAllConfig();
20
        $data = [];
21
        foreach ($siteConfig as $config) {
22
            $data[$config->configs_name] = $config->configs_value;
23
        }
24
        return $data;
25
    }
26
}