Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function notify($message, $severity = 'info', $event = null){ |
||
29 | curl_setopt_array($ch = curl_init(), array( |
||
30 | CURLOPT_URL => "https://api.pushover.net/1/messages.json", |
||
31 | CURLOPT_POST => true, |
||
32 | CURLOPT_RETURNTRANSFER => true, |
||
33 | CURLOPT_POSTFIELDS => http_build_query($data = array( |
||
34 | "token" => $this->token, |
||
35 | "user" => $this->user, |
||
36 | "message" => $code = strip_tags(preg_replace('/<([\/]?)span[^>]*>/i', '<\1b>', $message), "<b><i><u><a><font><p><br>"), |
||
37 | "title" => strip_tags($event), |
||
38 | "priority" => (int)array_search($severity, self::$priorities), |
||
39 | "timestamp" => time(), |
||
40 | "html" => preg_match('/<[^>]+>/', $code), |
||
41 | )), |
||
42 | )); |
||
43 | curl_exec($ch); |
||
44 | curl_close($ch); |
||
45 | } |
||
46 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.