Nil::__toString()   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 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Bluz Framework Component
5
 *
6
 * @copyright Bluz PHP Team
7
 * @link      https://github.com/bluzphp/framework
8
 */
9
10
declare(strict_types=1);
11
12
namespace Bluz\Common;
13
14
/**
15
 * It's just null class
16
 *
17
 * @package  Bluz\Common
18
 * @author   Anton Shevchuk
19
 * @link     https://github.com/bluzphp/framework/wiki/Trait-Nil
20
 *
21
 * @method   null get($key)
22
 * @method   null set($key, $value)
23
 */
24
class Nil
25
{
26
    /**
27
     * Magic call
28
     *
29
     * @param  string $method
30
     * @param  array  $args
31
     *
32
     * @return null
33
     */
34 1
    public function __call($method, $args)
35
    {
36 1
        return null;
37
    }
38
39
    /**
40
     * Magic call for static
41
     *
42
     * @param  string $method
43
     * @param  array  $args
44
     *
45
     * @return null
46
     */
47 1
    public static function __callStatic($method, $args)
48
    {
49 1
        return null;
50
    }
51
52
    /**
53
     * Magic __get
54
     *
55
     * @param  string $key
56
     *
57
     * @return null
58
     */
59 1
    public function __get($key)
60
    {
61 1
        return null;
62
    }
63
64
    /**
65
     * Magic __set
66
     *
67
     * @param  string $key
68
     * @param  mixed  $value
69
     *
70
     * @return null
71
     */
72 1
    public function __set($key, $value)
73
    {
74 1
        return null;
75
    }
76
77
    /**
78
     * Magic __isset
79
     *
80
     * @param  string $key
81
     *
82
     * @return false
83
     */
84 1
    public function __isset($key)
85
    {
86 1
        return false;
87
    }
88
89
    /**
90
     * Cast to empty string
91
     *
92
     * @return string
93
     */
94 1
    public function __toString()
95
    {
96 1
        return '';
97
    }
98
}
99