Passed
Pull Request — master (#42)
by Korotkov
02:47
created

Config::add()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 4
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 8
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author    : Jagepard <[email protected]">
7
 * @copyright Copyright (c) 2019, Jagepard
8
 * @license   https://mit-license.org/ MIT
9
 */
10
11
namespace Rudra\Container;
12
13
class Config extends AbstractContainer
14
{
15
    /**
16
     * @param $key
17
     * @param $value
18
     */
19
    public function add($key, $value): void
20
    {
21
        if (is_array($key) && array_key_exists(1, $key)) {
22
            $this->data[$key[0]][$key[1]] = $value;
23
            return;
24
        }
25
26
        $this->data[$key] = $value;
27
    }
28
}
29