X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryExternalLinks.php;h=71fd6d1b4b776cd7349c9e41ed5c32ce35511145;hb=fb79f30319b9ad2a7eb0f5f4d1668143ec8f963e;hp=725ac88b81f8f6f44e6a63e268c5067de95e45db;hpb=fac57b4b9692847c0473efedcff076fab873dbde;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryExternalLinks.php b/includes/api/ApiQueryExternalLinks.php index 725ac88b81..71fd6d1b4b 100644 --- a/includes/api/ApiQueryExternalLinks.php +++ b/includes/api/ApiQueryExternalLinks.php @@ -45,10 +45,10 @@ class ApiQueryExternalLinks extends ApiQueryBase { $query = $params['query']; $protocol = ApiQueryExtLinksUsage::getProtocolPrefix( $params['protocol'] ); - $this->addFields( array( + $this->addFields( [ 'el_from', 'el_to' - ) ); + ] ); $this->addTables( 'externallinks' ); $this->addWhereFld( 'el_from', array_keys( $this->getPageSet()->getGoodTitles() ) ); @@ -85,7 +85,7 @@ class ApiQueryExternalLinks extends ApiQueryBase { $this->setContinueEnumParameter( 'offset', $offset + $params['limit'] ); break; } - $entry = array(); + $entry = []; $to = $row->el_to; // expand protocol-relative urls if ( $params['expandurl'] ) { @@ -105,35 +105,35 @@ class ApiQueryExternalLinks extends ApiQueryBase { } public function getAllowedParams() { - return array( - 'limit' => array( + return [ + 'limit' => [ ApiBase::PARAM_DFLT => 10, ApiBase::PARAM_TYPE => 'limit', ApiBase::PARAM_MIN => 1, ApiBase::PARAM_MAX => ApiBase::LIMIT_BIG1, ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2 - ), - 'offset' => array( + ], + 'offset' => [ ApiBase::PARAM_TYPE => 'integer', ApiBase::PARAM_HELP_MSG => 'api-help-param-continue', - ), - 'protocol' => array( + ], + 'protocol' => [ ApiBase::PARAM_TYPE => ApiQueryExtLinksUsage::prepareProtocols(), ApiBase::PARAM_DFLT => '', - ), + ], 'query' => null, 'expandurl' => false, - ); + ]; } protected function getExamplesMessages() { - return array( + return [ 'action=query&prop=extlinks&titles=Main%20Page' => 'apihelp-query+extlinks-example-simple', - ); + ]; } public function getHelpUrls() { - return 'https://www.mediawiki.org/wiki/API:Extlinks'; + return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Extlinks'; } }