diff options
Diffstat (limited to 'MLEB/Translate/webservices/QueryAggregator.php')
-rw-r--r-- | MLEB/Translate/webservices/QueryAggregator.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/MLEB/Translate/webservices/QueryAggregator.php b/MLEB/Translate/webservices/QueryAggregator.php index bf9aa6e8..01d69cb3 100644 --- a/MLEB/Translate/webservices/QueryAggregator.php +++ b/MLEB/Translate/webservices/QueryAggregator.php @@ -61,17 +61,13 @@ class QueryAggregator { $clientOptions = [ 'reqTimeout' => $this->timeout, 'connTimeout' => 3, + // @phan-suppress-next-line PhanPossiblyUndeclaredVariable 'userAgent' => "MediaWiki Translate extension $version for $wgSitename" ]; $httpRequestFactory = MediaWikiServices::getInstance()->getHttpRequestFactory(); - // BC for MW < 1.35 - if ( is_callable( [ $httpRequestFactory, 'createMultiClient' ] ) ) { - $http = $httpRequestFactory->createMultiClient( $clientOptions ); - } else { - $http = new MultiHttpClient( $clientOptions ); - } + $http = $httpRequestFactory->createMultiClient( $clientOptions ); $responses = $http->runMulti( $this->getMultiHttpQueries( $this->queries ) ); foreach ( $responses as $index => $response ) { $this->responses[$index] = $response; @@ -85,7 +81,7 @@ class QueryAggregator { * @return array[] */ protected function getMultiHttpQueries( $queries ) { - $converter = function ( TranslationQuery $q ) { + $converter = static function ( TranslationQuery $q ) { return [ 'url' => $q->getUrl(), 'method' => $q->getMethod(), |