Passed
Push — master ( 67a15a...cb2889 )
by Nicolas
04:52
created

LoggerAware   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 32
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A error() 0 4 1
A warning() 0 4 1
A info() 0 4 1
A debug() 0 4 1
A setLogger() 0 6 1
1
<?php
2
3
namespace Karma\Logging;
4
5
use Psr\Log\LoggerInterface;
6
7
trait LoggerAware
8
{
9
    private
10
        $logger;
11
12
    public function setLogger(LoggerInterface $logger)
13
    {
14
        $this->logger = $logger;
15
16
        return $this;
17
    }
18
19
    private function error($message)
20
    {
21
        return $this->logger->error($message);
22
    }
23
24
    private function warning($message)
25
    {
26
        return $this->logger->warning($message);
27
    }
28
29
    private function info($message)
30
    {
31
        return $this->logger->info($message);
32
    }
33
34
    private function debug($message)
35
    {
36
        return $this->logger->debug($message);
37
    }
38
}
39