GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — master (#133)
by Yong
03:21
created

LogTrait::getLogFormat()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace AlibabaCloud\Client\Traits;
4
5
use Exception;
6
use Psr\Log\LoggerInterface;
7
8
/**
9
 * Trait LogTrait
10
 *
11
 * @package AlibabaCloud\Client\Traits
12
 */
13
trait LogTrait
14
{
15
    /**
16
     * @var LoggerInterface
17
     */
18
    private static $logger;
19
20
    /**
21
     * @var string
22
     */
23
    private static $logFormat;
24
25
    /**
26
     * @return LoggerInterface
27
     */
28 63
    public static function getLogger()
29
    {
30 63
        return self::$logger;
31
    }
32
33
    /**
34
     * @param LoggerInterface $logger
35
     *
36
     * @throws Exception
37
     */
38 1
    public static function setLogger(LoggerInterface $logger)
39
    {
40 1
        self::$logger = $logger;
41 1
    }
42
43
    /**
44
     * @return string
45
     */
46 2
    public static function getLogFormat()
47
    {
48
        return self::$logFormat
49 2
            ?: '"{method} {uri} HTTP/{version}" {code} {cost} {hostname} {pid}';
50
    }
51
52
    /**
53
     * Apache Common Log Format.
54
     *
55
     * @param string $formatter
56
     *
57
     * @link http://httpd.apache.org/docs/2.4/logs.html#common
58
     * @see  \GuzzleHttp\MessageFormatter
59
     */
60 1
    public static function setLogFormat($formatter)
61
    {
62 1
        self::$logFormat = $formatter;
63 1
    }
64
}
65