From ef394cacb4ba6dd2a1ceaae41bffb04712b8324c Mon Sep 17 00:00:00 2001 From: paladox Date: Thu, 3 Jan 2019 11:17:54 +0000 Subject: [PATCH] Make both send_curl_request and send_http_request and getMessage static 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 --- DiscordNotificationsCore.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DiscordNotificationsCore.php b/DiscordNotificationsCore.php index 66eebc1..eae15a9 100644 --- a/DiscordNotificationsCore.php +++ b/DiscordNotificationsCore.php @@ -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); @@ -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", @@ -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(); } }