Completed
Push — master ( fa6370...25cc22 )
by Eric
06:29
created

AbstractImmutableCollection::set()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace Oqq\Minc\Common\Collection;
4
5
use Oqq\Minc\Common\Collection\Exception\ImmutableCollectionMutateException;
6
7
/**
8
 * @author Eric Braun <[email protected]>
9
 */
10
abstract class AbstractImmutableCollection extends AbstractCollection implements ImmutableCollectionInterface
11
{
12
    /**
13
     * @inheritdoc
14
     */
15
    public function add($value)
16
    {
17
        $this->throwException();
18
    }
19
20
    /**
21
     * @inheritdoc
22
     */
23
    public function set($key, $value)
24
    {
25
        $this->throwException();
26
    }
27
28
    /**
29
     * @inheritdoc
30
     */
31
    public function remove($value)
32
    {
33
        $this->throwException();
34
    }
35
36
    /**
37
     * @inheritdoc
38
     */
39
    public function removeKey($key)
40
    {
41
        $this->throwException();
42
    }
43
44
    /**
45
     * @throws ImmutableCollectionMutateException
46
     */
47
    protected function throwException()
48
    {
49
        throw new ImmutableCollectionMutateException();
50
    }
51
}
52