ReadOnly::__unset()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 *
4
 */
5
6
namespace Mvc5\Config;
7
8
trait ReadOnly
9
{
10
    /**
11
     *
12
     */
13
    use Config {
14
        remove as protected;
15
        set as protected;
16
    }
17
18
    /**
19
     * @param string $name
20
     * @param mixed $value
21
     * @throws \Exception
22
     */
23 1
    function offsetSet($name, $value)
0 ignored issues
show
Unused Code introduced by
The parameter $name is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

23
    function offsetSet(/** @scrutinizer ignore-unused */ $name, $value)

This check looks for 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. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

23
    function offsetSet($name, /** @scrutinizer ignore-unused */ $value)

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

Loading history...
24
    {
25 1
        throw new \Exception('Invalid operation: object cannot be modified');
26
    }
27
28
    /**
29
     * @param string $name
30
     * @throws \Exception
31
     */
32 1
    function offsetUnset($name) : void
0 ignored issues
show
Unused Code introduced by
The parameter $name is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

32
    function offsetUnset(/** @scrutinizer ignore-unused */ $name) : void

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

Loading history...
33
    {
34 1
        throw new \Exception('Invalid operation: object cannot be modified');
35
    }
36
37
    /**
38
     * @param string $name
39
     * @param mixed $value
40
     * @throws \Exception
41
     */
42 1
    function __set($name, $value)
43
    {
44 1
        throw new \Exception('Invalid operation: object cannot be modified');
45
    }
46
47
    /**
48
     * @param string $name
49
     * @throws \Exception
50
     */
51 1
    function __unset($name) : void
52
    {
53 1
        throw new \Exception('Invalid operation: object cannot be modified');
54
    }
55
}
56