Merge "Move up devunt's name to Developers"
[lhc/web/wiklou.git] / includes / api / ApiQueryLangLinks.php
index 25e534e..67f2c9e 100644 (file)
@@ -44,21 +44,20 @@ class ApiQueryLangLinks extends ApiQueryBase {
                $prop = array_flip( (array)$params['prop'] );
 
                if ( isset( $params['title'] ) && !isset( $params['lang'] ) ) {
-                       $this->dieUsageMsg( array( 'missingparam', 'lang' ) );
+                       $this->dieUsageMsg( [ 'missingparam', 'lang' ] );
                }
 
                // Handle deprecated param
                $this->requireMaxOneParameter( $params, 'url', 'prop' );
                if ( $params['url'] ) {
-                       $this->logFeatureUsage( 'prop=langlinks&llurl' );
-                       $prop = array( 'url' => 1 );
+                       $prop = [ 'url' => 1 ];
                }
 
-               $this->addFields( array(
+               $this->addFields( [
                        'll_from',
                        'll_lang',
                        'll_title'
-               ) );
+               ] );
 
                $this->addTables( 'langlinks' );
                $this->addWhereFld( 'll_from', array_keys( $this->getPageSet()->getGoodTitles() ) );
@@ -75,7 +74,7 @@ class ApiQueryLangLinks extends ApiQueryBase {
                        );
                }
 
-               //FIXME: (follow-up) To allow extensions to add to the language links, we need
+               // FIXME: (follow-up) To allow extensions to add to the language links, we need
                //       to load them all, add the extra links, then apply paging.
                //       Should not be terrible, it's not going to be more than a few hundred links.
 
@@ -93,10 +92,10 @@ class ApiQueryLangLinks extends ApiQueryBase {
                        if ( count( $this->getPageSet()->getGoodTitles() ) == 1 ) {
                                $this->addOption( 'ORDER BY', 'll_lang' . $sort );
                        } else {
-                               $this->addOption( 'ORDER BY', array(
+                               $this->addOption( 'ORDER BY', [
                                        'll_from' . $sort,
                                        'll_lang' . $sort
-                               ) );
+                               ] );
                        }
                }
 
@@ -111,7 +110,7 @@ class ApiQueryLangLinks extends ApiQueryBase {
                                $this->setContinueEnumParameter( 'continue', "{$row->ll_from}|{$row->ll_lang}" );
                                break;
                        }
-                       $entry = array( 'lang' => $row->ll_lang );
+                       $entry = [ 'lang' => $row->ll_lang ];
                        if ( isset( $prop['url'] ) ) {
                                $title = Title::newFromText( "{$row->ll_lang}:{$row->ll_title}" );
                                if ( $title ) {
@@ -139,48 +138,48 @@ class ApiQueryLangLinks extends ApiQueryBase {
 
        public function getAllowedParams() {
                global $wgContLang;
-               return array(
-                       'prop' => array(
+               return [
+                       'prop' => [
                                ApiBase::PARAM_ISMULTI => true,
-                               ApiBase::PARAM_TYPE => array(
+                               ApiBase::PARAM_TYPE => [
                                        'url',
                                        'langname',
                                        'autonym',
-                               ),
-                               ApiBase::PARAM_HELP_MSG_PER_VALUE => array(),
-                       ),
+                               ],
+                               ApiBase::PARAM_HELP_MSG_PER_VALUE => [],
+                       ],
                        'lang' => null,
                        'title' => null,
-                       'dir' => array(
+                       'dir' => [
                                ApiBase::PARAM_DFLT => 'ascending',
-                               ApiBase::PARAM_TYPE => array(
+                               ApiBase::PARAM_TYPE => [
                                        'ascending',
                                        'descending'
-                               )
-                       ),
+                               ]
+                       ],
                        'inlanguagecode' => $wgContLang->getCode(),
-                       'limit' => array(
+                       '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
-                       ),
-                       'continue' => array(
+                       ],
+                       'continue' => [
                                ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
-                       ),
-                       'url' => array(
+                       ],
+                       'url' => [
                                ApiBase::PARAM_DFLT => false,
                                ApiBase::PARAM_DEPRECATED => true,
-                       ),
-               );
+                       ],
+               ];
        }
 
        protected function getExamplesMessages() {
-               return array(
+               return [
                        'action=query&prop=langlinks&titles=Main%20Page&redirects='
                                => 'apihelp-query+langlinks-example-simple',
-               );
+               ];
        }
 
        public function getHelpUrls() {