LoggerTrait::getLogger()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php declare(strict_types=1);
2
3
namespace Terah\ColourLog;
4
5
use Psr\Log\LoggerInterface;
6
7
/**
8
 * Basic Implementation of LoggerAwareInterface.
9
 */
10
trait LoggerTrait
11
{
12
    /** @var LoggerInterface */
13
    protected $logger;
14
15
    /**
16
     * Sets a logger.
17
     *
18
     * @param LoggerInterface $logger
19
     * @return $this
20
     */
21
    public function setLogger(LoggerInterface $logger)
22
    {
23
        $this->logger = $logger;
24
25
        return $this;
26
    }
27
28
    /**
29
     * Gets a logger.
30
     *
31
     * @return LoggerInterface
32
     */
33
    public function getLogger() : LoggerInterface
34
    {
35
        return $this->logger;
36
    }
37
}
38