Passed
Push — master ( b6cd05...9f5262 )
by Gaetano
05:39
created

LoggerAware::getLogger()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
namespace PhpXmlRpc\Traits;
4
5
use PhpXmlRpc\Helper\Logger;
6
7
trait LoggerAware
8
{
9
    protected static $logger;
10
11
    public function getLogger()
12
    {
13
        if (self::$logger === null) {
14
            self::$logger = Logger::instance();
15
        }
16
        return self::$logger;
17
    }
18
19
    /**
20
     * @param $logger
21
     * @return void
22
     */
23
    public static function setLogger($logger)
24
    {
25
        self::$logger = $logger;
26
    }
27
}
28