Config   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 5 1
A all() 0 4 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