Configuration::offsetUnset()   A
last analyzed

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
namespace Ackintosh\Ganesha;
3
4
use Ackintosh\Ganesha\Storage\StorageKeys;
5
6
class Configuration implements \ArrayAccess
7
{
8
    /**
9
     * @var array
10
     */
11
    private $params;
12
13
    public function __construct($params)
14
    {
15
        if (!isset($params['storageKeys'])) {
16
            $params['storageKeys'] = new StorageKeys();
17
        }
18
        $this->params = $params;
19
    }
20
21
    public function offsetSet($offset, $value)
22
    {
23
        $this->params[$offset] = $value;
24
    }
25
26
    public function offsetExists($offset)
27
    {
28
        return isset($this->params[$offset]);
29
    }
30
31
    public function offsetUnset($offset)
32
    {
33
        unset($this->params[$offset]);
34
    }
35
36
    public function offsetGet($offset)
37
    {
38
        return isset($this->params[$offset]) ? $this->params[$offset] : null;
39
    }
40
}
41