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

ParameterWire::injectParameter()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
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