Completed
Push — master ( 14db36...1f1b58 )
by Maxim
28:21
created

ApplicationConfig::offsetUnset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace WebComplete\mvc;
4
5
class ApplicationConfig implements \ArrayAccess
6
{
7
8
    /**
9
     * @var array
10
     */
11
    private $config;
12
13
    /**
14
     * @param array $config
15
     */
16
    public function __construct(array $config)
17
    {
18
        $this->config = $config;
19
    }
20
21
    /**
22
     * @return array
23
     */
24
    public function getData(): array
25
    {
26
        return $this->config;
27
    }
28
29
    /**
30
     * @param mixed $offset
31
     *
32
     * @return bool
33
     */
34
    public function offsetExists($offset): bool
35
    {
36
        return isset($this->config[$offset]);
37
    }
38
39
    /**
40
     * @param mixed $offset
41
     *
42
     * @return mixed|null
43
     */
44
    public function offsetGet($offset)
45
    {
46
        return $this->config[$offset] ?? null;
47
    }
48
49
    /**
50
     * @param mixed $offset
51
     * @param mixed $value
52
     */
53
    public function offsetSet($offset, $value)
54
    {
55
        $this->config[$offset] = $value;
56
    }
57
58
    /**
59
     * @param mixed $offset
60
     */
61
    public function offsetUnset($offset)
62
    {
63
        unset($this->config[$offset]);
64
    }
65
}
66