Completed
Push — master ( 43cd61...c32de9 )
by Iman
05:22
created

Chain   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 3 1
A startChain() 0 3 1
A push() 0 3 1
A get() 0 3 1
1
<?php
2
3
namespace Imanghafoori\HeyMan\Core;
4
5
class Chain
6
{
7
    /**
8
     * @var array
9
     */
10
    private $chainInfo = [];
11
12 106
    public function startChain()
13
    {
14 106
        $this->chainInfo = [];
15 106
    }
16
17 105
    public function get($key)
18
    {
19 105
        return $this->chainInfo[$key] ?? null;
20
    }
21
22 107
    public function set($key, $value)
23
    {
24 107
        $this->chainInfo[$key] = $value;
25 107
    }
26
27 92
    public function push($key, $value)
28
    {
29 92
        $this->chainInfo[$key][] = $value;
30 92
    }
31
}
32