Completed
Push — master ( 58af7c...c2ca97 )
by Camilo
01:44
created

DummyLogger   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 28%

Importance

Changes 0
Metric Value
wmc 9
dl 0
loc 44
ccs 7
cts 25
cp 0.28
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A debug() 0 3 1
A notice() 0 3 1
A critical() 0 3 1
A warning() 0 3 1
A error() 0 3 1
A emergency() 0 3 1
A alert() 0 3 1
A info() 0 3 1
A log() 0 2 1
1
<?php
2
3
namespace unreal4u\MQTT;
4
5
use Psr\Log\LoggerInterface;
6
use Psr\Log\LogLevel;
7
8
/**
9
 * Special class that will act as backup in case no logger is given
10
 *
11
 * As the name implies, this class won't do anything except declare the methods so we can still call them in this API.
12
 */
13
final class DummyLogger implements LoggerInterface
14
{
15
    public function emergency($message, array $context = array())
16
    {
17
        $this->log(LogLevel::EMERGENCY, $message, $context);
18
    }
19
20
    public function alert($message, array $context = array())
21
    {
22
        $this->log(LogLevel::ALERT, $message, $context);
23
    }
24
25
    public function critical($message, array $context = array())
26
    {
27
        $this->log(LogLevel::CRITICAL, $message, $context);
28
    }
29
30
    public function error($message, array $context = array())
31
    {
32
        $this->log(LogLevel::ERROR, $message, $context);
33
    }
34
35
    public function warning($message, array $context = array())
36
    {
37
        $this->log(LogLevel::WARNING, $message, $context);
38
    }
39
40
    public function notice($message, array $context = array())
41
    {
42
        $this->log(LogLevel::NOTICE, $message, $context);
43
    }
44
45 3
    public function info($message, array $context = array())
46
    {
47 3
        $this->log(LogLevel::INFO, $message, $context);
48 3
    }
49
50 20
    public function debug($message, array $context = array())
51
    {
52 20
        $this->log(LogLevel::DEBUG, $message, $context);
53 20
    }
54
55 20
    public function log($level, $message, array $context = array())
56
    {
57 20
    }
58
}
59