Skip to content

Commit

Permalink
Make both send_curl_request and send_http_request and getMessage stat…
Browse files Browse the repository at this point in the history
…ic functions (#23)

* Make both send_curl_request and send_http_request static functions

Am getting this in the log:

rrorException from line 410 of /srv/mediawiki/w/extensions/DiscordNotifications/DiscordNotificationsCore.php: PHP Deprecated: Non-static method DiscordNotifications::send_curl_request() should not be called statically

* Update DiscordNotificationsCore.php
  • Loading branch information
paladox authored and kulttuuri committed Jan 3, 2019
1 parent bcf22ce commit ef394ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions DiscordNotificationsCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ static function push_discord_notify($message, $user, $action)
}
}

private function send_curl_request($url, $postData) {
private static function send_curl_request($url, $postData) {
$h = curl_init();
curl_setopt($h, CURLOPT_URL, $url);
curl_setopt($h, CURLOPT_POST, 1);
Expand All @@ -425,7 +425,7 @@ private function send_curl_request($url, $postData) {
curl_close($h);
}

private function send_http_request($url, $postData) {
private static function send_http_request($url, $postData) {
$extradata = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
Expand All @@ -437,7 +437,7 @@ private function send_http_request($url, $postData) {
$result = file_get_contents($url, false, $context);
}

private function getMessage($key) {
private static function getMessage($key) {
return wfMessage( $key)->text();
}
}
Expand Down

0 comments on commit ef394ca

Please sign in to comment.