X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryPageProps.php;h=e49dfbcf1d347947b3de84261a8c1052b11785db;hb=d8653d2758016c6e13acefca55f38468eb32f30b;hp=ca85fe5f6c61a3cc343cc6d49c89d092884882ea;hpb=86c08b240167d01217d4cd628e978078b1ed7011;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryPageProps.php b/includes/api/ApiQueryPageProps.php index ca85fe5f6c..e49dfbcf1d 100644 --- a/includes/api/ApiQueryPageProps.php +++ b/includes/api/ApiQueryPageProps.php @@ -45,7 +45,7 @@ class ApiQueryPageProps extends ApiQueryBase { if ( $this->params['continue'] ) { $continueValue = intval( $this->params['continue'] ); $this->dieContinueUsageIf( strval( $continueValue ) !== $this->params['continue'] ); - $filteredPages = array(); + $filteredPages = []; foreach ( $pages as $id => $page ) { if ( $id >= $continueValue ) { $filteredPages[$id] = $page; @@ -60,7 +60,6 @@ class ApiQueryPageProps extends ApiQueryBase { } $pageProps = PageProps::getInstance(); - $props = array(); $result = $this->getResult(); if ( $this->params['prop'] ) { $propnames = $this->params['prop']; @@ -89,7 +88,7 @@ class ApiQueryPageProps extends ApiQueryBase { */ private function addPageProps( $result, $page, $props ) { ApiResult::setArrayType( $props, 'assoc' ); - $fit = $result->addValue( array( 'query', 'pages', $page ), 'pageprops', $props ); + $fit = $result->addValue( [ 'query', 'pages', $page ], 'pageprops', $props ); if ( !$fit ) { $this->setContinueEnumParameter( 'continue', $page ); @@ -103,24 +102,24 @@ class ApiQueryPageProps extends ApiQueryBase { } public function getAllowedParams() { - return array( - 'continue' => array( + return [ + 'continue' => [ ApiBase::PARAM_HELP_MSG => 'api-help-param-continue', - ), - 'prop' => array( + ], + 'prop' => [ ApiBase::PARAM_ISMULTI => true, - ), - ); + ], + ]; } protected function getExamplesMessages() { - return array( + return [ 'action=query&prop=pageprops&titles=Main%20Page|MediaWiki' => 'apihelp-query+pageprops-example-simple', - ); + ]; } public function getHelpUrls() { - return 'https://www.mediawiki.org/wiki/API:Pageprops'; + return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Pageprops'; } }