Merge "Remove unreachable block"
[lhc/web/wiklou.git] / includes / specials / SpecialMostcategories.php
index 95b76de..18083f6 100644 (file)
@@ -34,7 +34,7 @@ class MostcategoriesPage extends QueryPage {
                parent::__construct( $name );
        }
 
-       function isExpensive() {
+       public function isExpensive() {
                return true;
        }
 
@@ -42,22 +42,30 @@ class MostcategoriesPage extends QueryPage {
                return false;
        }
 
-       function getQueryInfo() {
-               return array (
-                       'tables' => array ( 'categorylinks', 'page' ),
-                       'fields' => array ( 'namespace' => 'page_namespace',
-                                       'title' => 'page_title',
-                                       'value' => 'COUNT(*)' ),
-                       'conds' => array ( 'page_namespace' => MWNamespace::getContentNamespaces() ),
-                       'options' => array ( 'HAVING' => 'COUNT(*) > 1',
-                               'GROUP BY' => array( 'page_namespace', 'page_title' ) ),
-                       'join_conds' => array ( 'page' => array ( 'LEFT JOIN',
-                                       'page_id = cl_from' ) )
+       public function getQueryInfo() {
+               return array(
+                       'tables' => array( 'categorylinks', 'page' ),
+                       'fields' => array(
+                               'namespace' => 'page_namespace',
+                               'title' => 'page_title',
+                               'value' => 'COUNT(*)'
+                       ),
+                       'conds' => array( 'page_namespace' => MWNamespace::getContentNamespaces() ),
+                       'options' => array(
+                               'HAVING' => 'COUNT(*) > 1',
+                               'GROUP BY' => array( 'page_namespace', 'page_title' )
+                       ),
+                       'join_conds' => array(
+                               'page' => array(
+                                       'LEFT JOIN',
+                                       'page_id = cl_from'
+                               )
+                       )
                );
        }
 
        /**
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param ResultWrapper $res
         */
        function preprocessResults( $db, $res ) {
@@ -84,8 +92,15 @@ class MostcategoriesPage extends QueryPage {
        function formatResult( $skin, $result ) {
                $title = Title::makeTitleSafe( $result->namespace, $result->title );
                if ( !$title ) {
-                       return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
-                               Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
+                       return Html::element(
+                               'span',
+                               array( 'class' => 'mw-invalidtitle' ),
+                               Linker::getInvalidTitleDescription(
+                                       $this->getContext(),
+                                       $result->namespace,
+                                       $result->title
+                               )
+                       );
                }
 
                if ( $this->isCached() ) {