Completed
Push — master ( 8885dc...0fe8b6 )
by Oscar
03:35
created

NullValue::__get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace SimpleCrud;
4
5
use JsonSerializable;
6
7
/**
8
 * Represent a null value.
9
 * Used to allow chaining even when the result is null
10
 */
11
class NullValue implements JsonSerializable
12
{
13
    /**
14
     * Magic method to return properties or load them automatically.
15
     *
16
     * @param string $name
17
     */
18
    public function __get($name)
0 ignored issues
show
Unused Code introduced by
The parameter $name 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...
19
    {
20
        return new NullValue();
21
    }
22
23
    /**
24
     * Magic method to store properties.
25
     *
26
     * @param string $name
27
     * @param mixed  $value
28
     */
29
    public function __set($name, $value)
0 ignored issues
show
Unused Code introduced by
The parameter $name 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...
30
    {
31
        throw new \Exception("No values can be stored in a RowNull");
32
    }
33
34
    /**
35
     * Magic method to check if a property is defined or is empty.
36
     *
37
     * @param string $name Property name
38
     *
39
     * @return bool
40
     */
41
    public function __isset($name)
0 ignored issues
show
Unused Code introduced by
The parameter $name 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...
42
    {
43
        return false;
44
    }
45
46
    /**
47
     * Magic method to print the row values (and subvalues).
48
     *
49
     * @return string
50
     */
51
    public function __toString()
52
    {
53
        return "";
54
    }
55
56
    /**
57
     * @see JsonSerializable
58
     *
59
     * @return mixed
60
     */
61
    public function jsonSerialize()
62
    {
63
        return null;
64
    }
65
}
66