From: Sam Reed Date: Tue, 8 Mar 2011 20:17:48 +0000 (+0000) Subject: More documentation and class definitions X-Git-Tag: 1.31.0-rc.0~31553 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=6d81d042f5e2bcfb797d4f587f47e326f19fc284;p=lhc%2Fweb%2Fwiklou.git More documentation and class definitions Few tweaks to braces --- diff --git a/includes/Category.php b/includes/Category.php index 614933fff2..9d9b5a67ba 100644 --- a/includes/Category.php +++ b/includes/Category.php @@ -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; diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index bbd3c438db..a5fbe8e41a 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -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 = '

' . htmlspecialchars( $articles_start_char[0] ) . "

\n"; $r .= '

" . htmlspecialchars( $articles_start_char[$index] ) . "

\n