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.

Logger::setDefaultLogger()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
namespace PhpBoot\Utils;
3
4
class Logger
5
{
6
    /**
7
     * System is unusable.
8
     *
9
     * @param string $message
10
     * @param array  $context
11
     *
12
     * @return void
13
     */
14
    static public function emergency($message, array $context = array())
15
    {
16
        self::getDefaultLogger()->{__FUNCTION__}($message, $context);
17
    }
18
19
    /**
20
     * Action must be taken immediately.
21
     *
22
     * Example: Entire website down, database unavailable, etc. This should
23
     * trigger the SMS alerts and wake you up.
24
     *
25
     * @param string $message
26
     * @param array  $context
27
     *
28
     * @return void
29
     */
30
    static public function alert($message, array $context = array())
31
    {
32
        self::getDefaultLogger()->{__FUNCTION__}($message, $context);
33
    }
34
35
    /**
36
     * Critical conditions.
37
     *
38
     * Example: Application component unavailable, unexpected exception.
39
     *
40
     * @param string $message
41
     * @param array  $context
42
     *
43
     * @return void
44
     */
45
    static public function critical($message, array $context = array())
46
    {
47
        self::getDefaultLogger()->{__FUNCTION__}($message, $context);
48
    }
49
50
    /**
51
     * Runtime errors that do not require immediate action but should typically
52
     * be logged and monitored.
53
     *
54
     * @param string $message
55
     * @param array  $context
56
     *
57
     * @return void
58
     */
59
    static public function error($message, array $context = array())
60
    {
61
        self::getDefaultLogger()->{__FUNCTION__}($message, $context);
62
    }
63
64
    /**
65
     * Exceptional occurrences that are not errors.
66
     *
67
     * Example: Use of deprecated APIs, poor use of an API, undesirable things
68
     * that are not necessarily wrong.
69
     *
70
     * @param string $message
71
     * @param array  $context
72
     *
73
     * @return void
74
     */
75 9
    static public function warning($message, array $context = array())
76
    {
77 9
        self::getDefaultLogger()->{__FUNCTION__}($message, $context);
78 9
    }
79
80
    /**
81
     * Normal but significant events.
82
     *
83
     * @param string $message
84
     * @param array  $context
85
     *
86
     * @return void
87
     */
88
    static public function notice($message, array $context = array())
89
    {
90
        self::getDefaultLogger()->{__FUNCTION__}($message, $context);
91
    }
92
93
    /**
94
     * Interesting events.
95
     *
96
     * Example: User logs in, SQL logs.
97
     *
98
     * @param string $message
99
     * @param array  $context
100
     *
101
     * @return void
102
     */
103
    public function info($message, array $context = array())
104
    {
105
        self::getDefaultLogger()->{__FUNCTION__}($message, $context);
106
    }
107
108
    /**
109
     * Detailed debug information.
110
     *
111
     * @param string $message
112
     * @param array  $context
113
     *
114
     * @return void
115
     */
116
    static public function debug($message, array $context = array())
117
    {
118
        self::getDefaultLogger()->{__FUNCTION__}($message, $context);
119
    }
120
121
    /**
122
     * Logs with an arbitrary level.
123
     *
124
     * @param mixed  $level
125
     * @param string $message
126
     * @param array  $context
127
     *
128
     * @return void
129
     */
130
    static public function log($level, $message, array $context = array())
131
    {
132
        self::getDefaultLogger()->log($level, $message, $context);
133
    }
134
135
    /**
136
     * @param \Monolog\Logger $defaultLogger
137
     */
138 89
    static public function setDefaultLogger($defaultLogger)
139
    {
140 89
        self::$defaultLogger = $defaultLogger;
141 89
    }
142
143
    /**
144
     * @return \Monolog\Logger
145
     */
146 9
    static public function getDefaultLogger()
147
    {
148 9
        if(!self::$defaultLogger){
149
            self::$defaultLogger = new \Monolog\Logger('default');
150
        }
151 9
        return self::$defaultLogger;
152
    }
153
154
    /**
155
     * @var \Monolog\Logger
156
     */
157
    static private $defaultLogger;
158
}