AdminOption   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 4
Bugs 1 Features 0
Metric Value
wmc 5
c 4
b 1
f 0
lcom 1
cbo 1
dl 0
loc 48
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 4 1
A has() 0 4 1
A all() 0 8 2
A set() 0 4 1
1
<?php namespace Mascame\Artificer\Options;
2
3
class AdminOption extends Option
4
{
5
6
    /**
7
     * @var string
8
     */
9
    public static $key = 'admin';
10
11
    /**
12
     * @param null $key
13
     * @return mixed
14
     */
15
    public static function get($key = null)
16
    {
17
        return Option::get(self::$key . '.' . $key);
18
    }
19
20
    /**
21
     * @param string $key
22
     * @return bool
23
     */
24
    public static function has($key = '')
25
    {
26
        return Option::has(self::$key . '.' . $key);
27
    }
28
29
    /**
30
     * @param null $key
31
     * @return mixed
32
     */
33
    public static function all($key = null)
34
    {
35
        if (!$key) {
36
            $key = self::$key;
37
        }
38
39
        return Option::get($key);
40
    }
41
42
    /**
43
     * @param string $key
44
     * @param $value
45
     */
46
    public static function set($key, $value)
47
    {
48
        Option::set(self::$key . '.' . $key, $value);
49
    }
50
}