r61430 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61429‎ | r61430 | r61431 >
Date:20:07, 23 January 2010
Author:ialex
Status:ok
Tags:
Comment:
* Document a bit
* Fix some doxygen warnings
* Use spaces instead of tabs in the middle of lines
Modified paths:
  • /trunk/phase3/includes/ImageQueryPage.php (modified) (history)
  • /trunk/phase3/includes/QueryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImageQueryPage.php
@@ -13,12 +13,12 @@
1414 * Format and output report results using the given information plus
1515 * OutputPage
1616 *
17 - * @param OutputPage $out OutputPage to print to
18 - * @param Skin $skin User skin to use
19 - * @param Database $dbr Database (read) connection to use
20 - * @param int $res Result pointer
21 - * @param int $num Number of available result rows
22 - * @param int $offset Paging offset
 17+ * @param $out OutputPage to print to
 18+ * @param $skin Skin: user skin to use
 19+ * @param $dbr Database (read) connection to use
 20+ * @param $res Integer: result pointer
 21+ * @param $num Integer: number of available result rows
 22+ * @param $offset Integer: paging offset
2323 */
2424 protected function outputResults( $out, $skin, $dbr, $res, $num, $offset ) {
2525 if( $num > 0 ) {
@@ -41,7 +41,7 @@
4242 /**
4343 * Prepare an image object given a result row
4444 *
45 - * @param object $row Result row
 45+ * @param $row Object: result row
4646 * @return Image
4747 */
4848 private function prepareImage( $row ) {
@@ -55,8 +55,8 @@
5656 /**
5757 * Get additional HTML to be shown in a results' cell
5858 *
59 - * @param object $row Result row
60 - * @return string
 59+ * @param $row Object: result row
 60+ * @return String
6161 */
6262 protected function getCellHtml( $row ) {
6363 return '';
Index: trunk/phase3/includes/QueryPage.php
@@ -22,36 +22,36 @@
2323 array( 'DisambiguationsPage', 'Disambiguations' ),
2424 array( 'DoubleRedirectsPage', 'DoubleRedirects' ),
2525 array( 'LinkSearchPage', 'LinkSearch' ),
26 - array( 'ListredirectsPage', 'Listredirects' ),
 26+ array( 'ListredirectsPage', 'Listredirects' ),
2727 array( 'LonelyPagesPage', 'Lonelypages' ),
2828 array( 'LongPagesPage', 'Longpages' ),
2929 array( 'MostcategoriesPage', 'Mostcategories' ),
3030 array( 'MostimagesPage', 'Mostimages' ),
3131 array( 'MostlinkedCategoriesPage', 'Mostlinkedcategories' ),
32 - array( 'SpecialMostlinkedtemplates', 'Mostlinkedtemplates' ),
 32+ array( 'SpecialMostlinkedtemplates', 'Mostlinkedtemplates' ),
3333 array( 'MostlinkedPage', 'Mostlinked' ),
3434 array( 'MostrevisionsPage', 'Mostrevisions' ),
3535 array( 'FewestrevisionsPage', 'Fewestrevisions' ),
3636 array( 'ShortPagesPage', 'Shortpages' ),
3737 array( 'UncategorizedCategoriesPage', 'Uncategorizedcategories' ),
3838 array( 'UncategorizedPagesPage', 'Uncategorizedpages' ),
39 - array( 'UncategorizedImagesPage', 'Uncategorizedimages' ),
40 - array( 'UncategorizedTemplatesPage', 'Uncategorizedtemplates' ),
 39+ array( 'UncategorizedImagesPage', 'Uncategorizedimages' ),
 40+ array( 'UncategorizedTemplatesPage', 'Uncategorizedtemplates' ),
4141 array( 'UnusedCategoriesPage', 'Unusedcategories' ),
4242 array( 'UnusedimagesPage', 'Unusedimages' ),
4343 array( 'WantedCategoriesPage', 'Wantedcategories' ),
4444 array( 'WantedFilesPage', 'Wantedfiles' ),
4545 array( 'WantedPagesPage', 'Wantedpages' ),
46 - array( 'WantedTemplatesPage', 'Wantedtemplates' ),
 46+ array( 'WantedTemplatesPage', 'Wantedtemplates' ),
4747 array( 'UnwatchedPagesPage', 'Unwatchedpages' ),
48 - array( 'UnusedtemplatesPage', 'Unusedtemplates' ),
49 - array( 'WithoutInterwikiPage', 'Withoutinterwiki' ),
 48+ array( 'UnusedtemplatesPage', 'Unusedtemplates' ),
 49+ array( 'WithoutInterwikiPage', 'Withoutinterwiki' ),
5050 );
5151 wfRunHooks( 'wgQueryPages', array( &$wgQueryPages ) );
5252
5353 global $wgDisableCounters;
5454 if ( !$wgDisableCounters )
55 - $wgQueryPages[] = array( 'PopularPagesPage', 'Popularpages' );
 55+ $wgQueryPages[] = array( 'PopularPagesPage', 'Popularpages' );
5656
5757
5858 /**
@@ -79,7 +79,7 @@
8080 /**
8181 * A mutator for $this->listoutput;
8282 *
83 - * @param bool $bool
 83+ * @param $bool Boolean
8484 */
8585 function setListoutput( $bool ) {
8686 $this->listoutput = $bool;
@@ -89,6 +89,8 @@
9090 * Subclasses return their name here. Make sure the name is also
9191 * specified in SpecialPage.php and in Language.php as a language message
9292 * param.
 93+ *
 94+ * @return String
9395 */
9496 function getName() {
9597 return '';
@@ -124,6 +126,8 @@
125127
126128 /**
127129 * Override to sort by increasing values
 130+ *
 131+ * @return Boolean
128132 */
129133 function sortDescending() {
130134 return true;
@@ -138,8 +142,10 @@
139143 * Is this query expensive (for some definition of expensive)? Then we
140144 * don't let it run in miser mode. $wgDisableQueryPages causes all query
141145 * pages to be declared expensive. Some query pages are always expensive.
 146+ *
 147+ * @return Boolean
142148 */
143 - function isExpensive( ) {
 149+ function isExpensive() {
144150 global $wgDisableQueryPages;
145151 return $wgDisableQueryPages;
146152 }
@@ -148,7 +154,7 @@
149155 * Whether or not the output of the page in question is retrived from
150156 * the database cache.
151157 *
152 - * @return bool
 158+ * @return Boolean
153159 */
154160 function isCached() {
155161 global $wgMiserMode;
@@ -158,6 +164,8 @@
159165
160166 /**
161167 * Sometime we dont want to build rss / atom feeds.
 168+ *
 169+ * @return Boolean
162170 */
163171 function isSyndicated() {
164172 return true;
@@ -168,6 +176,9 @@
169177 * skin; you can use it for making links. The result is a single row of
170178 * result data. You should be able to grab SQL results off of it.
171179 * If the function return "false", the line output will be skipped.
 180+ *
 181+ * @param $skin Skin object
 182+ * @param $result Object: database row
172183 */
173184 function formatResult( $skin, $result ) {
174185 return '';
@@ -175,8 +186,10 @@
176187
177188 /**
178189 * The content returned by this function will be output before any result
 190+ *
 191+ * @return String
179192 */
180 - function getPageHeader( ) {
 193+ function getPageHeader() {
181194 return '';
182195 }
183196
@@ -184,7 +197,8 @@
185198 * If using extra form wheely-dealies, return a set of parameters here
186199 * as an associative array. They will be encoded and added to the paging
187200 * links (prev/next/lengths).
188 - * @return array
 201+ *
 202+ * @return Array
189203 */
190204 function linkParameters() {
191205 return array();
@@ -196,12 +210,15 @@
197211 * Setting this to return true, will call one more time wfFormatResult to
198212 * be sure that the very last result is formatted and shown.
199213 */
200 - function tryLastResult( ) {
 214+ function tryLastResult() {
201215 return false;
202216 }
203217
204218 /**
205219 * Clear the cache and save new results
 220+ *
 221+ * @param $limit Integer: limit for SQL statement
 222+ * @param $ignoreErrors Boolean: whether to ignore database errors
206223 */
207224 function recache( $limit, $ignoreErrors = true ) {
208225 $fname = get_class( $this ) . '::recache';
@@ -376,12 +393,12 @@
377394 * Format and output report results using the given information plus
378395 * OutputPage
379396 *
380 - * @param OutputPage $out OutputPage to print to
381 - * @param Skin $skin User skin to use
382 - * @param Database $dbr Database (read) connection to use
383 - * @param int $res Result pointer
384 - * @param int $num Number of available result rows
385 - * @param int $offset Paging offset
 397+ * @param $out OutputPage to print to
 398+ * @param $skin Skin: user skin to use
 399+ * @param $dbr Database (read) connection to use
 400+ * @param $res Integer: result pointer
 401+ * @param $num Integer: number of available result rows
 402+ * @param $offset Integer: paging offset
386403 */
387404 protected function outputResults( $out, $skin, $dbr, $res, $num, $offset ) {
388405 global $wgContLang;

Status & tagging log