Introducing ContentGetParserOutput hook.
[lhc/web/wiklou.git] / includes / Category.php
index b9c9609..126b8fe 100644 (file)
@@ -40,7 +40,8 @@ class Category {
        /** Counts of membership (cat_pages, cat_subcats, cat_files) */
        private $mPages = null, $mSubcats = null, $mFiles = null;
 
-       private function __construct() { }
+       private function __construct() {
+       }
 
        /**
         * Set up all member variables using a database query.
@@ -75,11 +76,11 @@ class Category {
                        # Okay, there were no contents.  Nothing to initialize.
                        if ( $this->mTitle ) {
                                # If there is a title object but no record in the category table, treat this as an empty category
-                               $this->mID      = false;
-                               $this->mName    = $this->mTitle->getDBkey();
-                               $this->mPages   = 0;
+                               $this->mID = false;
+                               $this->mName = $this->mTitle->getDBkey();
+                               $this->mPages = 0;
                                $this->mSubcats = 0;
-                               $this->mFiles   = 0;
+                               $this->mFiles = 0;
 
                                return true;
                        } else {
@@ -87,11 +88,11 @@ class Category {
                        }
                }
 
-               $this->mID      = $row->cat_id;
-               $this->mName    = $row->cat_title;
-               $this->mPages   = $row->cat_pages;
+               $this->mID = $row->cat_id;
+               $this->mName = $row->cat_title;
+               $this->mPages = $row->cat_pages;
                $this->mSubcats = $row->cat_subcats;
-               $this->mFiles   = $row->cat_files;
+               $this->mFiles = $row->cat_files;
 
                # (bug 13683) If the count is negative, then 1) it's obviously wrong
                # and should not be kept, and 2) we *probably* don't have to scan many
@@ -106,7 +107,7 @@ class Category {
        /**
         * Factory function.
         *
-        * @param $name Array: A category name (no "Category:" prefix).  It need
+        * @param array $name A category name (no "Category:" prefix).  It need
         *   not be normalized, with spaces replaced by underscores.
         * @return mixed Category, or false on a totally invalid name
         */
@@ -167,7 +168,7 @@ class Category {
 
                # NOTE: the row often results from a LEFT JOIN on categorylinks. This may result in
                #       all the cat_xxx fields being null, if the category page exists, but nothing
-               #       was ever added to the category. This case should be treated linke an empty
+               #       was ever added to the category. This case should be treated link an empty
                #       category, if possible.
 
                if ( $row->cat_title === null ) {
@@ -179,16 +180,16 @@ class Category {
                                $cat->mName = $title->getDBkey(); # if we have a title object, fetch the category name from there
                        }
 
-                       $cat->mID =   false;
+                       $cat->mID = false;
                        $cat->mSubcats = 0;
-                       $cat->mPages   = 0;
-                       $cat->mFiles   = 0;
+                       $cat->mPages = 0;
+                       $cat->mFiles = 0;
                } else {
-                       $cat->mName    = $row->cat_title;
-                       $cat->mID      = $row->cat_id;
+                       $cat->mName = $row->cat_title;
+                       $cat->mID = $row->cat_id;
                        $cat->mSubcats = $row->cat_subcats;
-                       $cat->mPages   = $row->cat_pages;
-                       $cat->mFiles   = $row->cat_files;
+                       $cat->mPages = $row->cat_pages;
+                       $cat->mFiles = $row->cat_files;
                }
 
                return $cat;
@@ -350,9 +351,9 @@ class Category {
                wfProfileOut( __METHOD__ );
 
                # Now we should update our local counts.
-               $this->mPages   = $result->pages;
+               $this->mPages = $result->pages;
                $this->mSubcats = $result->subcats;
-               $this->mFiles   = $result->files;
+               $this->mFiles = $result->files;
 
                return $ret;
        }