1 | <?php |
||
28 | class Logger |
||
29 | { |
||
30 | const DEFAULT_NAMESPACE = 'PSFS'; |
||
31 | use SingletonTrait; |
||
32 | /** |
||
33 | * @var \Monolog\Logger |
||
34 | */ |
||
35 | protected $logger; |
||
36 | /** |
||
37 | * @var resource |
||
38 | */ |
||
39 | private $stream; |
||
40 | /** |
||
41 | * @var UidProcessor |
||
42 | */ |
||
43 | private $uuid; |
||
44 | /** |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $log_level; |
||
48 | |||
49 | /** |
||
50 | * Logger constructor. |
||
51 | * @throws exception\GeneratorException |
||
52 | */ |
||
53 | 1 | public function __construct() |
|
62 | |||
63 | public function __destruct() |
||
67 | |||
68 | /** |
||
69 | * @param string $logger |
||
70 | * @param boolean $debug |
||
71 | * @param Config $config |
||
72 | * @throws \Exception |
||
73 | */ |
||
74 | 1 | private function addPushLogger($logger, $debug, Config $config) |
|
91 | |||
92 | /** |
||
93 | * @param Config $config |
||
94 | * @param array $args |
||
95 | * @return array |
||
96 | * @throws exception\GeneratorException |
||
97 | */ |
||
98 | 1 | private function setup(Config $config, array $args = []) |
|
110 | |||
111 | /** |
||
112 | * @param Config $config |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | 1 | private function setLoggerName(Config $config) |
|
123 | |||
124 | /** |
||
125 | * @param $logger |
||
126 | * |
||
127 | * @return mixed |
||
128 | */ |
||
129 | 1 | private function cleanLoggerName($logger) |
|
136 | |||
137 | /** |
||
138 | * @param Config $config |
||
139 | * @return string |
||
140 | * @throws exception\GeneratorException |
||
141 | */ |
||
142 | 1 | private function createLoggerPath(Config $config) |
|
150 | |||
151 | /** |
||
152 | * @param string $msg |
||
153 | * @param int $type |
||
154 | * @param array $context |
||
155 | * @return bool |
||
156 | */ |
||
157 | 28 | public function addLog($msg, $type = LOG_DEBUG, array $context = []) { |
|
160 | |||
161 | /** |
||
162 | * @param string $msg |
||
163 | * @param int $type |
||
164 | * @param array $context |
||
|
|||
165 | */ |
||
166 | 28 | public static function log($msg, $type = LOG_DEBUG, array $context = null) |
|
187 | |||
188 | /** |
||
189 | * @param bool $debug |
||
190 | * @return StreamHandler |
||
191 | * @throws \Exception |
||
192 | */ |
||
193 | 1 | private function addDefaultStreamHandler($debug = false) |
|
205 | |||
206 | /** |
||
207 | * @param array $context |
||
208 | * @return array |
||
209 | */ |
||
210 | 28 | private function addMinimalContext(array $context = []) |
|
219 | |||
220 | /** |
||
221 | * @return string |
||
222 | */ |
||
223 | public function getLogUid() { |
||
226 | |||
227 | /** |
||
228 | * @return string |
||
229 | */ |
||
230 | public static function getUid() { |
||
233 | } |
||
234 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive. In addition it looks for parameters that have the generic type
array
and suggests a stricter type likearray<String>
.Most often this is a case of a parameter that can be null in addition to its declared types.