Completed
Push — nln-php7 ( 6680df...1a6b54 )
by Nicolas
02:06
created

LoggerAware   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 32
ccs 11
cts 11
cp 1
rs 10
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Karma\Logging;
6
7
use Psr\Log\LoggerInterface;
8
9
trait LoggerAware
10
{
11
    private LoggerInterface
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
12
        $logger;
13
14 270
    public function setLogger(LoggerInterface $logger)
15
    {
16 270
        $this->logger = $logger;
17
18 270
        return $this;
19
    }
20
21 36
    private function error($message)
22
    {
23 36
        return $this->logger->error($message);
24
    }
25
26 207
    private function warning($message)
27
    {
28 207
        return $this->logger->warning($message);
29
    }
30
31 334
    private function info($message)
32
    {
33 334
        return $this->logger->info($message);
34
    }
35
36 63
    private function debug($message)
37
    {
38 63
        return $this->logger->debug($message);
39
    }
40
}
41