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

Config   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A add() 0 8 3
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