Passed
Push — master ( 68213e...d07337 )
by Mike
02:37
created

AbstractDependencyProvider::offsetUnset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
4
namespace Xervice\Core\Dependency;
5
6
7
abstract class AbstractDependencyProvider implements DependencyProviderInterface
8
{
9
    /**
10
     * @var callable[]
11
     */
12
    protected $container;
13
14
    /**
15
     * @param mixed $offset
16
     *
17
     * @return bool
18
     */
19
    public function offsetExists($offset): bool
20
    {
21
        return isset($this->container[$offset]);
22
    }
23
24
    /**
25
     * @param mixed $offset
26
     *
27
     * @return callable
28
     */
29
    public function offsetGet($offset)
30
    {
31
        return $this->container[$offset];
32
    }
33
34
    /**
35
     * @param mixed $offset
36
     * @param mixed $value
37
     */
38 1
    public function offsetSet($offset, $value)
39
    {
40 1
        $this->set($offset, $value);
41 1
    }
42
43
    /**
44
     * @param mixed $offset
45
     */
46
    public function offsetUnset($offset)
47
    {
48
        unset($this->container[$offset]);
49
    }
50
51
}