Config::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace XHGui;
4
5
/**
6
 * Loads and reads config file.
7
 */
8
class Config
9
{
10
    private static $config = [];
11
12
    /**
13
     * Load a config file, it will replace
14
     * all the currently loaded configuration.
15
     */
16
    public static function load($file): void
17
    {
18
        $config = include $file;
19
        self::$config = array_merge(self::$config, $config);
20
    }
21
22
    /**
23
     * Get all the configuration options.
24
     *
25
     * @return array
26
     */
27
    public static function all()
28
    {
29
        return self::$config;
30
    }
31
}
32