ImmutableArrayAccessTrait::offsetSet()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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