1 | <?php |
||
8 | class MonologLogger implements Logger |
||
9 | { |
||
10 | /** |
||
11 | * Monolog instance. |
||
12 | * |
||
13 | * @var Monolog\Logger |
||
14 | */ |
||
15 | private $monolog; |
||
16 | |||
17 | /** |
||
18 | * Initialize logger with Monolog instance. |
||
19 | * |
||
20 | * @param Monolog\Logger $monolog |
||
21 | */ |
||
22 | public function __construct(Monolog $monolog) |
||
26 | |||
27 | /** |
||
28 | * System is unusable. |
||
29 | * |
||
30 | * @param string $message |
||
31 | * @param array $context |
||
32 | */ |
||
33 | public function emergency($message, array $context = []) |
||
37 | |||
38 | /** |
||
39 | * Action must be taken immediately. |
||
40 | * |
||
41 | * Example: Entire website down, database unavailable, etc. This should |
||
42 | * trigger the SMS alerts and wake you up. |
||
43 | * |
||
44 | * @param string $message |
||
45 | * @param array $context |
||
46 | */ |
||
47 | public function alert($message, array $context = []) |
||
51 | |||
52 | /** |
||
53 | * Critical conditions. |
||
54 | * |
||
55 | * Example: Application component unavailable, unexpected exception. |
||
56 | * |
||
57 | * @param string $message |
||
58 | * @param array $context |
||
59 | */ |
||
60 | public function critical($message, array $context = []) |
||
64 | |||
65 | /** |
||
66 | * Runtime errors that do not require immediate action but should typically |
||
67 | * be logged and monitored. |
||
68 | * |
||
69 | * @param string $message |
||
70 | * @param array $context |
||
71 | */ |
||
72 | public function error($message, array $context = []) |
||
76 | |||
77 | /** |
||
78 | * Exceptional occurrences that are not errors. |
||
79 | * |
||
80 | * Example: Use of deprecated APIs, poor use of an API, undesirable things |
||
81 | * that are not necessarily wrong. |
||
82 | * |
||
83 | * @param string $message |
||
84 | * @param array $context |
||
85 | */ |
||
86 | public function warning($message, array $context = []) |
||
90 | |||
91 | /** |
||
92 | * Normal but significant events. |
||
93 | * |
||
94 | * @param string $message |
||
95 | * @param array $context |
||
96 | */ |
||
97 | public function notice($message, array $context = []) |
||
101 | |||
102 | /** |
||
103 | * Interesting events. |
||
104 | * |
||
105 | * Example: User logs in, SQL logs. |
||
106 | * |
||
107 | * @param string $message |
||
108 | * @param array $context |
||
109 | */ |
||
110 | public function info($message, array $context = []) |
||
114 | |||
115 | /** |
||
116 | * Detailed debug information. |
||
117 | * |
||
118 | * @param string $message |
||
119 | * @param array $context |
||
120 | */ |
||
121 | public function debug($message, array $context = []) |
||
125 | |||
126 | /** |
||
127 | * Logs with an arbitrary level. |
||
128 | * |
||
129 | * @param mixed $level |
||
130 | * @param string $message |
||
131 | * @param array $context |
||
132 | */ |
||
133 | public function log($level, $message, array $context = []) |
||
137 | } |
||
138 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..