Completed
Push — master ( bee542...31e600 )
by James Ekow Abaka
01:58
created

Bindings::remove()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace ntentan\panie;
4
5
class Bindings {
6
7
    private $bindings = [];
8
    private $activeKey;
9
10 5
    public function setActiveKey($activeKey) {
11
        $this->activeKey = $activeKey;
12 5
        return $this;
13 5
    }
14
15
    public function to($value) {
16 5
        $this->bindings[$this->activeKey] = ['class' => $value];
17
        return $this;
18 5
    }
19 5
20
    public function get($key) {
21 5
        return $this->bindings[$key];
22
    }
23 5
24
    public function has($key) {
25
        return isset($this->bindings[$key]);
26 7
    }
27
    
28 7
    public function asSingleton() {
29
        $this->bindings[$this->activeKey]['singleton'] = true;
30
    }
31
    
32
    public function remove($type) {
33
        unset($this->bindings[$type]);
34
    }
35
36
}
37