Completed
Push — master ( 71fe6c...2dd80e )
by Koldo
02:32
created

ContainerConfig::set()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Antidot\Container;
6
7
class ContainerConfig
8
{
9
    private $config;
10
11 13
    public function __construct(array $config)
12
    {
13 13
        $this->config = $config;
14 13
    }
15
16 13
    public function get(string $id)
17
    {
18 13
        return $this->config[$id];
19
    }
20
21 13
    public function has($id): bool
22
    {
23 13
        return array_key_exists($id, $this->config);
24
    }
25
26
    public function unset(string $id): void
27
    {
28
        unset($this->config[$id]);
29
    }
30
31
    public function set(string $id, $param): void
32
    {
33
        $this->config[$id] = $param;
34
    }
35
}
36