Completed
Push — master ( 2b2467...86fe2f )
by Marco
12:06
created

NullLogger   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 94
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 9
c 2
b 0
f 0
lcom 0
cbo 0
dl 94
loc 94
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A emergency() 1 1 1
A alert() 1 1 1
A critical() 1 1 1
A error() 1 1 1
A warning() 1 1 1
A notice() 1 1 1
A info() 1 1 1
A debug() 1 1 1
A log() 1 1 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php namespace Comodojo\RpcClient\Utils;
2
3
use Psr\Log\LoggerInterface;
4
5
/**
6
 * A simple, PSR-3 compliant, null logger.
7
 *
8
 * @package     Comodojo Spare Parts
9
 * @author      Marco Giovinazzi <[email protected]>
10
 * @license     MIT
11
 *
12
 * LICENSE:
13
 *
14
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
 * THE SOFTWARE.
21
 */
22
23 View Code Duplication
class NullLogger implements LoggerInterface {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
24
25
    /**
26
     * emergency
27
     *
28
     * @param string $message
29
     * @param array  $context
30
     *
31
     * @return null
32
     */
33
    public function emergency($message, array $context = array()) { return; }
34
35
    /**
36
     * alert
37
     *
38
     * @param string $message
39
     * @param array  $context
40
     *
41
     * @return null
42
     */
43
    public function alert($message, array $context = array()) { return; }
44
45
    /**
46
     * critical
47
     *
48
     * @param string $message
49
     * @param array  $context
50
     *
51
     * @return null
52
     */
53
    public function critical($message, array $context = array()) { return; }
54
55
    /**
56
     * error
57
     *
58
     * @param string $message
59
     * @param array  $context
60
     *
61
     * @return null
62
     */
63
    public function error($message, array $context = array()) { return; }
64
65
    /**
66
     * warning
67
     *
68
     * @param string $message
69
     * @param array  $context
70
     *
71
     * @return null
72
     */
73
    public function warning($message, array $context = array()) { return; }
74
75
    /**
76
     * notice
77
     *
78
     * @param string $message
79
     * @param array  $context
80
     *
81
     * @return null
82
     */
83
    public function notice($message, array $context = array()) { return; }
84
85
    /**
86
     * info
87
     *
88
     * @param string $message
89
     * @param array  $context
90
     *
91
     * @return null
92
     */
93
    public function info($message, array $context = array()) { return; }
94
95
    /**
96
     * debug
97
     *
98
     * @param string $message
99
     * @param array  $context
100
     *
101
     * @return null
102
     */
103
    public function debug($message, array $context = array()) { return; }
104
105
    /**
106
     * log
107
     *
108
     * @param mixed  $level
109
     * @param string $message
110
     * @param array  $context
111
     *
112
     * @return null
113
     */
114
    public function log($level, $message, array $context = array()) { return; }
115
116
}
117