1 | <?php |
||
14 | class Sentry extends AbstractWriter |
||
15 | { |
||
16 | /** |
||
17 | * @var Client |
||
18 | */ |
||
19 | protected $client; |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $priorityMap = [ |
||
25 | Logger::EMERG => Raven_Client::FATAL, |
||
26 | Logger::ALERT => Raven_Client::ERROR, |
||
27 | Logger::CRIT => Raven_Client::ERROR, |
||
28 | Logger::ERR => Raven_Client::ERROR, |
||
29 | Logger::WARN => Raven_Client::WARNING, |
||
30 | Logger::NOTICE => Raven_Client::INFO, |
||
31 | Logger::INFO => Raven_Client::INFO, |
||
32 | Logger::DEBUG => Raven_Client::DEBUG, |
||
33 | ]; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $excludedBacktraceNamespaces = [ |
||
39 | 'Facile\\SentryModule\\Log\\', |
||
40 | 'Psr\\Log\\', |
||
41 | 'Zend\\Log\\', |
||
42 | 'Monolog\\', |
||
43 | ]; |
||
44 | |||
45 | /** |
||
46 | * Sentry constructor. |
||
47 | * |
||
48 | * @param array $options |
||
49 | * |
||
50 | * @throws \RuntimeException |
||
51 | * @throws \Zend\Log\Exception\InvalidArgumentException |
||
52 | */ |
||
53 | 7 | public function __construct(array $options = null) |
|
77 | |||
78 | /** |
||
79 | * Write a message to the log. |
||
80 | * |
||
81 | * @param array $event log data event |
||
82 | */ |
||
83 | 5 | protected function doWrite(array $event) |
|
130 | |||
131 | /** |
||
132 | * Remove first backtrace items until it founds something different from loggers. |
||
133 | * |
||
134 | * @param array $backtrace |
||
135 | * |
||
136 | * @return array |
||
137 | */ |
||
138 | 3 | protected function cleanBacktrace(array $backtrace) |
|
168 | |||
169 | /** |
||
170 | * @param array $context |
||
171 | * |
||
172 | * @return array |
||
173 | */ |
||
174 | 5 | protected function sanitizeContextData(array $context) |
|
180 | |||
181 | /** |
||
182 | * @param mixed $value |
||
183 | */ |
||
184 | 4 | protected function sanitizeContextItem(&$value) |
|
200 | |||
201 | /** |
||
202 | * @param mixed $object |
||
203 | * |
||
204 | * @return bool |
||
205 | */ |
||
206 | 2 | protected function objectIsThrowable($object) |
|
210 | |||
211 | /** |
||
212 | * @param array $context |
||
213 | * |
||
214 | * @return bool |
||
215 | */ |
||
216 | 5 | protected function contextContainsException(array $context) |
|
224 | } |
||
225 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.