Completed
Push — master ( e2ac41...8604fd )
by Park Jong-Hun
08:45
created

ParameterWire   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 19
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A appendParameter() 0 7 1
A injectParameter() 0 6 2
1
<?php
2
3
namespace Core;
4
5
use Prob\Handler\ParameterMap;
6
use Prob\Handler\ParameterInterface;
7
8
class ParameterWire
9
{
10
    private static $parameters = [];
11
12
    public static function appendParameter(ParameterInterface $key, $value)
13
    {
14
        self::$parameters[] = [
15
            'key' => $key,
16
            'value' => $value
17
        ];
18
    }
19
20
    public static function injectParameter(ParameterMap $map)
21
    {
22
        foreach (self::$parameters as $v) {
23
            $map->bindBy($v['key'], $v['value']);
24
        }
25
    }
26
}
27