Completed
Push — master ( 1f8f60...98572a )
by Koldo
02:48
created

ParamCollection   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 22
ccs 10
cts 10
cp 1
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 3 1
A __construct() 0 3 1
A has() 0 3 1
A get() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Antidot\Container;
6
7
class ParamCollection
8
{
9
    private $parameters;
10
11 9
    public function __construct(array $parameters)
12
    {
13 9
        $this->parameters = $parameters;
14 9
    }
15
16 8
    public function set(string $id, $parameters): void
17
    {
18 8
        $this->parameters[$id] = $parameters;
19 8
    }
20
21 8
    public function has($id): bool
22
    {
23 8
        return array_key_exists($id, $this->parameters);
24
    }
25
26 5
    public function get(string $id)
27
    {
28 5
        return $this->parameters[$id];
29
    }
30
}
31