AdminOption::set()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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