Call method with the same name it's defined with
[lhc/web/wiklou.git] / includes / api / ApiPageSet.php
index b05cb2b..6c4bb08 100644 (file)
@@ -112,7 +112,8 @@ class ApiPageSet extends ApiBase {
 
        /**
         * Populate the PageSet from the request parameters.
-        * @param bool $isDryRun If true, instantiates generator, but only to mark relevant parameters as used
+        * @param bool $isDryRun If true, instantiates generator, but only to mark
+        *    relevant parameters as used
         */
        private function executeInternal( $isDryRun ) {
                $this->profileIn();
@@ -200,8 +201,9 @@ class ApiPageSet extends ApiBase {
                                                break;
                                        case 'revids':
                                                if ( $this->mResolveRedirects ) {
-                                                       $this->setWarning( 'Redirect resolution cannot be used together with the revids= parameter. ' .
-                                                               'Any redirects the revids= point to have not been resolved.' );
+                                                       $this->setWarning( 'Redirect resolution cannot be used ' .
+                                                               'together with the revids= parameter. Any redirects ' .
+                                                               'the revids= point to have not been resolved.' );
                                                }
                                                $this->mResolveRedirects = false;
                                                $this->initFromRevIDs( $this->mParams['revids'] );
@@ -244,6 +246,7 @@ class ApiPageSet extends ApiBase {
                if ( isset( $this->mParams['revids'] ) ) {
                        return 'revids';
                }
+
                return null;
        }
 
@@ -289,6 +292,7 @@ class ApiPageSet extends ApiBase {
                $this->mRequestedPageFields = array_diff_key( $this->mRequestedPageFields, $pageFlds );
 
                $pageFlds = array_merge( $pageFlds, $this->mRequestedPageFields );
+
                return array_keys( $pageFlds );
        }
 
@@ -391,6 +395,7 @@ class ApiPageSet extends ApiBase {
                if ( !empty( $values ) && $result ) {
                        $result->setIndexedTagName( $values, 'r' );
                }
+
                return $values;
        }
 
@@ -421,6 +426,7 @@ class ApiPageSet extends ApiBase {
                if ( !empty( $values ) && $result ) {
                        $result->setIndexedTagName( $values, 'n' );
                }
+
                return $values;
        }
 
@@ -451,6 +457,7 @@ class ApiPageSet extends ApiBase {
                if ( !empty( $values ) && $result ) {
                        $result->setIndexedTagName( $values, 'c' );
                }
+
                return $values;
        }
 
@@ -487,6 +494,7 @@ class ApiPageSet extends ApiBase {
                if ( !empty( $values ) && $result ) {
                        $result->setIndexedTagName( $values, 'i' );
                }
+
                return $values;
        }
 
@@ -522,6 +530,7 @@ class ApiPageSet extends ApiBase {
                if ( !empty( $values ) && $result ) {
                        $result->setIndexedTagName( $values, 'rev' );
                }
+
                return $values;
        }
 
@@ -642,7 +651,7 @@ class ApiPageSet extends ApiBase {
                // Get pageIDs data from the `page` table
                $this->profileDBIn();
                $res = $db->select( 'page', $this->getPageTableFields(), $set,
-                                       __METHOD__ );
+                       __METHOD__ );
                $this->profileDBOut();
 
                // Hack: get the ns:titles stored in array(ns => array(titles)) format
@@ -676,7 +685,7 @@ class ApiPageSet extends ApiBase {
                        // Get pageIDs data from the `page` table
                        $this->profileDBIn();
                        $res = $db->select( 'page', $this->getPageTableFields(), $set,
-                                               __METHOD__ );
+                               __METHOD__ );
                        $this->profileDBOut();
                }
 
@@ -863,7 +872,12 @@ class ApiPageSet extends ApiBase {
                foreach ( $res as $row ) {
                        $rdfrom = intval( $row->rd_from );
                        $from = $this->mPendingRedirectIDs[$rdfrom]->getPrefixedText();
-                       $to = Title::makeTitle( $row->rd_namespace, $row->rd_title, $row->rd_fragment, $row->rd_interwiki );
+                       $to = Title::makeTitle(
+                               $row->rd_namespace,
+                               $row->rd_title,
+                               $row->rd_fragment,
+                               $row->rd_interwiki
+                       );
                        unset( $this->mPendingRedirectIDs[$rdfrom] );
                        if ( !$to->isExternal() && !isset( $this->mAllPages[$row->rd_namespace][$row->rd_title] ) ) {
                                $lb->add( $row->rd_namespace, $row->rd_title );
@@ -886,6 +900,7 @@ class ApiPageSet extends ApiBase {
                                unset( $this->mPendingRedirectIDs[$id] );
                        }
                }
+
                return $lb;
        }
 
@@ -941,8 +956,9 @@ class ApiPageSet extends ApiBase {
                                // Variants checking
                                global $wgContLang;
                                if ( $this->mConvertTitles &&
-                                               count( $wgContLang->getVariants() ) > 1 &&
-                                               !$titleObj->exists() ) {
+                                       count( $wgContLang->getVariants() ) > 1 &&
+                                       !$titleObj->exists()
+                               ) {
                                        // Language::findVariantLink will modify titleText and titleObj into
                                        // the canonical variant if possible
                                        $titleText = is_string( $title ) ? $title : $titleObj->getPrefixedText();
@@ -1040,6 +1056,7 @@ class ApiPageSet extends ApiBase {
                                $result['generator'] = null;
                        }
                }
+
                return $result;
        }
 
@@ -1067,6 +1084,7 @@ class ApiPageSet extends ApiBase {
                        sort( $gens );
                        self::$generators = $gens;
                }
+
                return self::$generators;
        }
 
@@ -1075,19 +1093,34 @@ class ApiPageSet extends ApiBase {
                        'titles' => 'A list of titles to work on',
                        'pageids' => 'A list of page IDs to work on',
                        'revids' => 'A list of revision IDs to work on',
-                       'generator' => array( 'Get the list of pages to work on by executing the specified query module.',
-                               'NOTE: generator parameter names must be prefixed with a \'g\', see examples' ),
+                       'generator' => array(
+                               'Get the list of pages to work on by executing the specified query module.',
+                               'NOTE: generator parameter names must be prefixed with a \'g\', see examples'
+                       ),
                        'redirects' => 'Automatically resolve redirects',
-                       'converttitles' => array( 'Convert titles to other variants if necessary. Only works if the wiki\'s content language supports variant conversion.',
-                               'Languages that support variant conversion include ' . implode( ', ', LanguageConverter::$languagesWithVariants ) ),
+                       'converttitles' => array(
+                               'Convert titles to other variants if necessary. Only works if ' .
+                                       'the wiki\'s content language supports variant conversion.',
+                               'Languages that support variant conversion include ' .
+                                       implode( ', ', LanguageConverter::$languagesWithVariants )
+                       ),
                );
        }
 
        public function getPossibleErrors() {
                return array_merge( parent::getPossibleErrors(), array(
-                       array( 'code' => 'multisource', 'info' => "Cannot use 'pageids' at the same time as 'dataSource'" ),
-                       array( 'code' => 'multisource', 'info' => "Cannot use 'revids' at the same time as 'dataSource'" ),
-                       array( 'code' => 'badgenerator', 'info' => 'Module $generatorName cannot be used as a generator' ),
+                       array(
+                               'code' => 'multisource',
+                               'info' => "Cannot use 'pageids' at the same time as 'dataSource'"
+                       ),
+                       array(
+                               'code' => 'multisource',
+                               'info' => "Cannot use 'revids' at the same time as 'dataSource'"
+                       ),
+                       array(
+                               'code' => 'badgenerator',
+                               'info' => 'Module $generatorName cannot be used as a generator'
+                       ),
                ) );
        }
 }