Passed
Pull Request — dev (#47)
by Stone
04:17 queued 01:57
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
     */
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
}