Passed
Push — master ( d230a4...5a3c9e )
by Iman
07:16
created

ChainManager   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 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 3 1
A set() 0 3 1
A push() 0 3 1
A startChain() 0 3 1
1
<?php
2
3
namespace Imanghafoori\HeyMan;
4
5
class ChainManager
6
{
7
    /**
8
     * @var \Imanghafoori\HeyMan\Chain
9
     */
10
    private $chainInfo = [];
11
12
    public function startChain()
13
    {
14 105
        $this->chainInfo = [];
0 ignored issues
show
Documentation Bug introduced by
It seems like array() of type array is incompatible with the declared type Imanghafoori\HeyMan\Chain of property $chainInfo.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
15
    }
16 105
17
    public function get($key)
18
    {
19
        return $this->chainInfo[$key] ?? null;
20
    }
21
22 105
    public function set($key, $value)
23
    {
24 96
        $this->chainInfo[$key] = $value;
25
    }
26 96
27 96
    public function push($key, $value)
28 96
    {
29
        $this->chainInfo[$key][] = $value;
30 104
    }
31
}
32