Index: trunk/phase3/includes/cache/LinkBatch.php |
— | — | @@ -86,7 +86,8 @@ |
87 | 87 | |
88 | 88 | /** |
89 | 89 | * Do the query and add the results to the LinkCache object |
90 | | - * Return an array mapping PDBK to ID |
| 90 | + * |
| 91 | + * @return Array mapping PDBK to ID |
91 | 92 | */ |
92 | 93 | public function execute() { |
93 | 94 | $linkCache = LinkCache::singleton(); |
— | — | @@ -96,6 +97,9 @@ |
97 | 98 | /** |
98 | 99 | * Do the query and add the results to a given LinkCache object |
99 | 100 | * Return an array mapping PDBK to ID |
| 101 | + * |
| 102 | + * @param $cache LinkCache |
| 103 | + * @return Array remaining IDs |
100 | 104 | */ |
101 | 105 | protected function executeInto( &$cache ) { |
102 | 106 | wfProfileIn( __METHOD__ ); |
— | — | @@ -112,8 +116,9 @@ |
113 | 117 | * This function *also* stores extra fields of the title used for link |
114 | 118 | * parsing to avoid extra DB queries. |
115 | 119 | * |
116 | | - * @param $cache |
| 120 | + * @param $cache LinkCache |
117 | 121 | * @param $res |
| 122 | + * @return Array of remaining titles |
118 | 123 | */ |
119 | 124 | public function addResultToCache( $cache, $res ) { |
120 | 125 | if ( !$res ) { |
— | — | @@ -144,6 +149,7 @@ |
145 | 150 | |
146 | 151 | /** |
147 | 152 | * Perform the existence test query, return a ResultWrapper with page_id fields |
| 153 | + * @return Bool|ResultWrapper |
148 | 154 | */ |
149 | 155 | public function doQuery() { |
150 | 156 | if ( $this->isEmpty() ) { |
— | — | @@ -168,6 +174,11 @@ |
169 | 175 | return $res; |
170 | 176 | } |
171 | 177 | |
| 178 | + /** |
| 179 | + * Do (and cache) {{GENDER:...}} information for userpages in this LinkBatch |
| 180 | + * |
| 181 | + * @return bool whether the query was successful |
| 182 | + */ |
172 | 183 | public function doGenderQuery() { |
173 | 184 | if ( $this->isEmpty() ) { |
174 | 185 | return false; |
— | — | @@ -180,6 +191,7 @@ |
181 | 192 | |
182 | 193 | $genderCache = GenderCache::singleton(); |
183 | 194 | $genderCache->dolinkBatch( $this->data, $this->caller ); |
| 195 | + return true; |
184 | 196 | } |
185 | 197 | |
186 | 198 | /** |
Index: trunk/phase3/includes/UserArray.php |
— | — | @@ -77,6 +77,9 @@ |
78 | 78 | return $this->res->numRows(); |
79 | 79 | } |
80 | 80 | |
| 81 | + /** |
| 82 | + * @return User |
| 83 | + */ |
81 | 84 | function current() { |
82 | 85 | return $this->current; |
83 | 86 | } |
Index: trunk/phase3/includes/Pager.php |
— | — | @@ -95,7 +95,10 @@ |
96 | 96 | |
97 | 97 | /** True if the current result set is the first one */ |
98 | 98 | public $mIsFirst; |
| 99 | + public $mIsLast; |
99 | 100 | |
| 101 | + protected $mLastShown, $mFirstShown, $mPastTheEndIndex, $mDefaultQuery, $mNavigationBar; |
| 102 | + |
100 | 103 | /** |
101 | 104 | * Result object for the query. Warning: seek before use. |
102 | 105 | * |
— | — | @@ -190,12 +193,16 @@ |
191 | 194 | |
192 | 195 | /** |
193 | 196 | * Set the offset from an other source than the request |
| 197 | + * |
| 198 | + * @param $offset Int|String |
194 | 199 | */ |
195 | 200 | function setOffset( $offset ) { |
196 | 201 | $this->mOffset = $offset; |
197 | 202 | } |
198 | 203 | /** |
199 | 204 | * Set the limit from an other source than the request |
| 205 | + * |
| 206 | + * @param $limit Int|String |
200 | 207 | */ |
201 | 208 | function setLimit( $limit ) { |
202 | 209 | $this->mLimit = $limit; |
— | — | @@ -497,6 +504,8 @@ |
498 | 505 | * $linkTexts will be used. Both $linkTexts and $disabledTexts are arrays |
499 | 506 | * of HTML. |
500 | 507 | * |
| 508 | + * @param $linkTexts Array |
| 509 | + * @param $disabledTexts Array |
501 | 510 | * @return Array |
502 | 511 | */ |
503 | 512 | function getPagingLinks( $linkTexts, $disabledTexts = array() ) { |
— | — | @@ -619,9 +628,12 @@ |
620 | 629 | * @ingroup Pager |
621 | 630 | */ |
622 | 631 | abstract class AlphabeticPager extends IndexPager { |
| 632 | + |
623 | 633 | /** |
624 | 634 | * Shamelessly stolen bits from ReverseChronologicalPager, |
625 | 635 | * didn't want to do class magic as may be still revamped |
| 636 | + * |
| 637 | + * @return String HTML |
626 | 638 | */ |
627 | 639 | function getNavigationBar() { |
628 | 640 | if ( !$this->isNavigationBarShown() ) return ''; |
— | — | @@ -884,9 +896,13 @@ |
885 | 897 | return "<tr><td colspan=\"$colspan\">$msgEmpty</td></tr>\n"; |
886 | 898 | } |
887 | 899 | |
| 900 | + /** |
| 901 | + * @param $row Array |
| 902 | + * @return String HTML |
| 903 | + */ |
888 | 904 | function formatRow( $row ) { |
889 | 905 | $this->mCurrentRow = $row; # In case formatValue etc need to know |
890 | | - $s = Xml::openElement( 'tr', $this->getRowAttrs($row) ); |
| 906 | + $s = Xml::openElement( 'tr', $this->getRowAttrs( $row ) ); |
891 | 907 | $fieldNames = $this->getFieldNames(); |
892 | 908 | foreach ( $fieldNames as $field => $name ) { |
893 | 909 | $value = isset( $row->$field ) ? $row->$field : null; |
— | — | @@ -914,7 +930,7 @@ |
915 | 931 | * Get attributes to be applied to the given row. |
916 | 932 | * |
917 | 933 | * @param $row Object: the database result row |
918 | | - * @return Associative array |
| 934 | + * @return Array of <attr> => <value> |
919 | 935 | */ |
920 | 936 | function getRowAttrs( $row ) { |
921 | 937 | $class = $this->getRowClass( $row ); |
— | — | @@ -931,9 +947,9 @@ |
932 | 948 | * take this as an excuse to hardcode styles; use classes and |
933 | 949 | * CSS instead. Row context is available in $this->mCurrentRow |
934 | 950 | * |
935 | | - * @param $field The column |
936 | | - * @param $value The cell contents |
937 | | - * @return Associative array |
| 951 | + * @param $field String The column |
| 952 | + * @param $value String The cell contents |
| 953 | + * @return Array of attr => value |
938 | 954 | */ |
939 | 955 | function getCellAttrs( $field, $value ) { |
940 | 956 | return array( 'class' => 'TablePager_col_' . $field ); |
— | — | @@ -957,6 +973,7 @@ |
958 | 974 | |
959 | 975 | /** |
960 | 976 | * A navigation bar with images |
| 977 | + * @return String HTML |
961 | 978 | */ |
962 | 979 | function getNavigationBar() { |
963 | 980 | global $wgStylePath; |
— | — | @@ -1044,6 +1061,7 @@ |
1045 | 1062 | * Resubmits all defined elements of the query string, except for a |
1046 | 1063 | * blacklist, passed in the $blacklist parameter. |
1047 | 1064 | * |
| 1065 | + * @param $blacklist Array parameters from the request query which should not be resubmitted |
1048 | 1066 | * @return String: HTML fragment |
1049 | 1067 | */ |
1050 | 1068 | function getHiddenFields( $blacklist = array() ) { |
— | — | @@ -1120,6 +1138,8 @@ |
1121 | 1139 | * An array mapping database field names to a textual description of the |
1122 | 1140 | * field name, for use in the table header. The description should be plain |
1123 | 1141 | * text, it will be HTML-escaped later. |
| 1142 | + * |
| 1143 | + * @return Array |
1124 | 1144 | */ |
1125 | 1145 | abstract function getFieldNames(); |
1126 | 1146 | } |