Passed
Push — master ( bc3840...800ced )
by Camilo
01:52
created

DummyLogger::withName()   A

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
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
crap 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 29
    public function withName(string $name): self
0 ignored issues
show
Unused Code introduced by
The parameter $name is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

15
    public function withName(/** @scrutinizer ignore-unused */ string $name): self

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
16
    {
17 29
        return $this;
18
    }
19
20
    public function emergency($message, array $context = array())
21
    {
22
        $this->log(LogLevel::EMERGENCY, $message, $context);
23
    }
24
25
    public function alert($message, array $context = array())
26
    {
27
        $this->log(LogLevel::ALERT, $message, $context);
28
    }
29
30
    public function critical($message, array $context = array())
31
    {
32
        $this->log(LogLevel::CRITICAL, $message, $context);
33
    }
34
35
    public function error($message, array $context = array())
36
    {
37
        $this->log(LogLevel::ERROR, $message, $context);
38
    }
39
40
    public function warning($message, array $context = array())
41
    {
42
        $this->log(LogLevel::WARNING, $message, $context);
43
    }
44
45
    public function notice($message, array $context = array())
46
    {
47
        $this->log(LogLevel::NOTICE, $message, $context);
48
    }
49
50 3
    public function info($message, array $context = array())
51
    {
52 3
        $this->log(LogLevel::INFO, $message, $context);
53 3
    }
54
55 4
    public function debug($message, array $context = array())
56
    {
57 4
        $this->log(LogLevel::DEBUG, $message, $context);
58 4
    }
59
60 5
    public function log($level, $message, array $context = array())
61
    {
62 5
    }
63
}
64