diff options
Diffstat (limited to 'MLEB/Translate/webservices/MicrosoftWebService.php')
-rw-r--r-- | MLEB/Translate/webservices/MicrosoftWebService.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/MLEB/Translate/webservices/MicrosoftWebService.php b/MLEB/Translate/webservices/MicrosoftWebService.php index 88dcf53c..eb7fa0ff 100644 --- a/MLEB/Translate/webservices/MicrosoftWebService.php +++ b/MLEB/Translate/webservices/MicrosoftWebService.php @@ -8,6 +8,8 @@ * @license GPL-2.0-or-later */ +use MediaWiki\MediaWikiServices; + /** * Implements support for Microsoft translation api v3. * @see https://docs.microsoft.com/fi-fi/azure/cognitive-services/Translator/reference/v3-0-reference @@ -29,7 +31,7 @@ class MicrosoftWebService extends TranslationWebService { 'pt-br' => 'pt', ]; - return isset( $map[$code] ) ? $map[$code] : $code; + return $map[$code] ?? $code; } protected function doPairs() { @@ -45,7 +47,8 @@ class MicrosoftWebService extends TranslationWebService { $url = $this->config['url'] . '/languages?api-version=3.0'; - $req = MWHttpRequest::factory( $url, $options ); + $req = MediaWikiServices::getInstance()->getHttpRequestFactory() + ->create( $url, $options, __METHOD__ ); $req->setHeader( 'Ocp-Apim-Subscription-Key', $key ); $status = $req->execute(); |