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

SiteConfig::getSiteConfig()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 0
dl 0
loc 10
rs 10
c 0
b 0
f 0
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
}