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

ContainerConfig   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 58.33%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 27
ccs 7
cts 12
cp 0.5833
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A has() 0 3 1
A get() 0 3 1
A set() 0 3 1
A unset() 0 3 1
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