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

DummyLogger::warning()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 2
crap 2
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