More documentation and class definitions
authorSam Reed <reedy@users.mediawiki.org>
Tue, 8 Mar 2011 20:17:48 +0000 (20:17 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 8 Mar 2011 20:17:48 +0000 (20:17 +0000)
Few tweaks to braces

includes/Category.php
includes/CategoryPage.php

index 614933f..9d9b5a6 100644 (file)
@@ -13,7 +13,10 @@ class Category {
        /** Name of the category, normalized to DB-key form */
        private $mName = null;
        private $mID = null;
-       /** Category page title */
+       /**
+        * Category page title
+        * @var Title
+        */
        private $mTitle = null;
        /** Counts of membership (cat_pages, cat_subcats, cat_files) */
        private $mPages = null, $mSubcats = null, $mFiles = null;
@@ -100,7 +103,7 @@ class Category {
         * Factory function.
         *
         * @param $title Title for the category page
-        * @return Mixed: category, or false on a totally invalid name
+        * @return category|false on a totally invalid name
         */
        public static function newFromTitle( $title ) {
                $cat = new self();
@@ -129,7 +132,7 @@ class Category {
         * @param $row result set row, must contain the cat_xxx fields. If the fields are null,
         *        the resulting Category object will represent an empty category if a title object
         *        was given. If the fields are null and no title was given, this method fails and returns false.
-        * @param $title optional title object for the category represented by the given row.
+        * @param Title $title optional title object for the category represented by the given row.
         *        May be provided if it is already known, to avoid having to re-create a title object later.
         * @return Category
         */
@@ -182,7 +185,7 @@ class Category {
        public function getFileCount() { return $this->getX( 'mFiles' ); }
 
        /**
-        * @return mixed The Title for this category, or false on failure.
+        * @return Title|false Title for this category, or false on failure.
         */
        public function getTitle() {
                if ( $this->mTitle ) return $this->mTitle;
index bbd3c43..a5fbe8e 100644 (file)
@@ -82,15 +82,48 @@ class CategoryPage extends Article {
 }
 
 class CategoryViewer {
-       var $title, $limit, $from, $until,
+       var $limit, $from, $until,
                $articles, $articles_start_char,
                $children, $children_start_char,
-               $showGallery, $gallery,
-               $imgsNoGalley, $imgsNoGallery_start_char,
-               $skin, $collation;
-       # Category object for this page
+               $showGallery, $imgsNoGalley,
+               $imgsNoGallery_start_char,
+               $skin, $imgsNoGallery;
+
+       /**
+        * @var 
+        */
+       var $nextPage;
+
+       /**
+        * @var Array
+        */
+       var $flip;
+
+       /**
+        * @var Title
+        */
+       var $title;
+
+       /**
+        * @var Collation
+        */
+       var $collation;
+
+       /**
+        * @var ImageGallery
+        */
+       var $gallery;
+
+       /**
+        * Category object for this page
+        * @var Category
+        */
        private $cat;
-       # The original query array, to be used in generating paging links.
+
+       /**
+        * The original query array, to be used in generating paging links.
+        * @var array
+        */
        private $query;
 
        function __construct( $title, $from = '', $until = '', $query = array() ) {
@@ -160,6 +193,9 @@ class CategoryViewer {
                }
        }
 
+       /**
+        * @return Skin
+        */
        function getSkin() {
                if ( !$this->skin ) {
                        global $wgUser;
@@ -202,6 +238,9 @@ class CategoryViewer {
        * entry in the categorylinks table is Category:A, not A, which it SHOULD be.
        * Workaround: If sortkey == "Category:".$title, than use $title for sorting,
        * else use sortkey...
+       *
+       * @param Title $title
+       * @param string $sortkey
        */
        function getSubcategorySortChar( $title, $sortkey ) {
                global $wgContLang;
@@ -528,10 +567,8 @@ class CategoryViewer {
        static function shortList( $articles, $articles_start_char ) {
                $r = '<h3>' . htmlspecialchars( $articles_start_char[0] ) . "</h3>\n";
                $r .= '<ul><li>' . $articles[0] . '</li>';
-               for ( $index = 1; $index < count( $articles ); $index++ )
-               {
-                       if ( $articles_start_char[$index] != $articles_start_char[$index - 1] )
-                       {
+               for ( $index = 1; $index < count( $articles ); $index++ ) {
+                       if ( $articles_start_char[$index] != $articles_start_char[$index - 1] ) {
                                $r .= "</ul><h3>" . htmlspecialchars( $articles_start_char[$index] ) . "</h3>\n<ul>";
                        }
 
@@ -629,8 +666,7 @@ class CategoryViewer {
                }
 
                if ( $dbcnt == $rescnt || ( ( $rescnt == $this->limit || $fromOrUntil )
-                       && $dbcnt > $rescnt ) )
-               {
+                       && $dbcnt > $rescnt ) ) {
                        # Case 1: seems sane.
                        $totalcnt = $dbcnt;
                } elseif ( $rescnt < $this->limit && !$fromOrUntil ) {