ImmutableArrayAccessTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A offsetSet() 0 4 1
A offsetUnset() 0 4 1
1
<?php
2
3
namespace SubjectivePHP\Spl\Traits;
4
5
use RuntimeException;
6
7
trait ImmutableArrayAccessTrait
8
{
9
    /**
10
     * Sets the value at the specified index $offset to $value
11
     *
12
     * @param string|integer $offset The index being set.
13
     * @param mixed          $value  The new value for the index.
14
     *
15
     * @return void
16
     *
17
     * @throws RuntimeException Always Thrown
18
     */
19
    public function offsetSet($offset, $value)
0 ignored issues
show
Unused Code introduced by
The parameter $offset is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $value is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
20
    {
21
        throw new RuntimeException('This ArrayAccess object is readonly');
22
    }
23
24
    /**
25
     * Unsets the value at the specified index
26
     *
27
     * @param mixed $offset The index being unset.
28
     *
29
     * @return void
30
     *
31
     * @throws RuntimeException Always Thrown
32
     */
33
    public function offsetUnset($offset)
0 ignored issues
show
Unused Code introduced by
The parameter $offset is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
34
    {
35
        throw new RuntimeException('This ArrayAccess object is readonly');
36
    }
37
}
38