LoggerAwareTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getLogger() 0 3 1
1
<?php
2
3
namespace Simpliste\Log;
4
5
use Psr\Log\LoggerAwareTrait as PsrLoggerAwareTrait;
6
use Psr\Log\LoggerInterface;
7
use Psr\Log\NullLogger;
8
9
/**
10
 * Trait LoggerAwareTrait
11
 *
12
 * @package Simpliste\Log
13
 */
14
trait LoggerAwareTrait
15
{
16
    use PsrLoggerAwareTrait;
17
18
    /**
19
     * @return LoggerInterface
20
     */
21
    public function getLogger(): LoggerInterface
22
    {
23
        return $this->logger ?? new NullLogger();
24
    }
25
}