r99814 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99813‎ | r99814 | r99815 >
Date:21:28, 14 October 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Fix more comments
Modified paths:
  • /trunk/extensions/Collection/Collection.body.php (modified) (history)
  • /trunk/extensions/Collection/Collection.hooks.php (modified) (history)
  • /trunk/extensions/Collection/Collection.php (modified) (history)
  • /trunk/extensions/Collection/Collection.session.php (modified) (history)
  • /trunk/extensions/Collection/Collection.suggest.php (modified) (history)
  • /trunk/extensions/Collection/Collection.templates.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/actions/ApiReview.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/actions/ApiReviewActivity.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/actions/ApiStabilize.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/reports/ApiFlagConfig.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/reports/ApiQueryConfiguredPages.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/reports/ApiQueryFlagged.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/reports/ApiQueryOldreviewedpages.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/reports/ApiQueryReviewedpages.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/reports/ApiQueryUnreviewedpages.php (modified) (history)
  • /trunk/extensions/LiquidThreads/api/ApiFeedLQTThreads.php (modified) (history)
  • /trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php (modified) (history)
  • /trunk/extensions/OpenSearchXml/OpenSearchXml.php (modified) (history)
  • /trunk/extensions/PrefSwitch/PrefSwitch.classes.php (modified) (history)
  • /trunk/extensions/ProofreadPage/ApiQueryProofread.php (modified) (history)
  • /trunk/extensions/WikiLove/WikiLove.local.php (modified) (history)
  • /trunk/extensions/Wikimania/Wikimania.php (modified) (history)
  • /trunk/extensions/Wikimania/backend/Wikimania.php (modified) (history)
  • /trunk/extensions/Wikimania/backend/WikimaniaRegistration.php (modified) (history)
  • /trunk/extensions/Wikimania/specials/SpecialCheckWikimaniaStatus.php (modified) (history)
  • /trunk/extensions/Wikimania/specials/SpecialRegisterForWikimania.php (modified) (history)
  • /trunk/extensions/WikimediaMaintenance/cleanupTitles64966.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiLove/WikiLove.local.php
@@ -1,5 +1,5 @@
22 <?php
3 -/*
 3+/**
44 * Custom ResourceLoader module that loads a custom WikiLove.js per-wiki.
55 */
66 class WikiLoveLocal extends ResourceLoaderWikiModule {
@@ -8,7 +8,7 @@
99 'MediaWiki:WikiLove.js' => array( 'type' => 'script' ),
1010 );
1111 }
12 -
 12+
1313 public function getMessages() {
1414 global $wgWikiLoveOptionMessages;
1515 return $wgWikiLoveOptionMessages;
Index: trunk/extensions/LiquidThreads/api/ApiFeedLQTThreads.php
@@ -1,5 +1,5 @@
22 <?php
3 -/*
 3+/**
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
66 * the Free Software Foundation; either version 2 of the License, or
Index: trunk/extensions/ProofreadPage/ApiQueryProofread.php
@@ -1,5 +1,5 @@
22 <?php
3 -/*
 3+/**
44 * Created on August 8, 2011
55 *
66 * API module for MediaWiki's Proofread extension
@@ -72,7 +72,7 @@
7373 if ( !isset( $qualityLevels[ $title ] ) ) {
7474 continue;
7575 }
76 -
 76+
7777 $pageQuality = $qualityLevels[ $title ];
7878 $val = array( 'quality' => $pageQuality, 'quality_text' => $qualityText[ $pageQuality ] );
7979 $result->addValue( array( 'query', 'pages', $pageid ), 'proofread', $val );
Index: trunk/extensions/PrefSwitch/PrefSwitch.classes.php
@@ -1,5 +1,5 @@
22 <?php
3 -/*
 3+/**
44 * Classes for PrefSwitch extension
55 *
66 * @file
@@ -7,9 +7,9 @@
88 */
99
1010 class PrefSwitchSurvey {
11 -
 11+
1212 /* Private Static Members */
13 -
 13+
1414 // Correlation between names of field types and implementation classes
1515 protected static $fieldTypes = array(
1616 'select' => 'PrefSwitchSurveyFieldSelect',
@@ -20,9 +20,9 @@
2121 'text' => 'PrefSwitchSurveyFieldText',
2222 'smallinput' => 'PrefSwitchSurveyFieldSmallInput',
2323 );
24 -
 24+
2525 /* Static Methods */
26 -
 26+
2727 /**
2828 * Render the HTML for a survey.
2929 * @param $name string Survey name
@@ -57,7 +57,7 @@
5858 $html .= Xml::closeElement( 'dl' );
5959 return $html;
6060 }
61 -
 61+
6262 /**
6363 * Save a survey to the database
6464 * @param $name string Survey name
@@ -85,10 +85,10 @@
8686 }
8787 }
8888 }
89 -interface PrefSwitchSurveyField {
 89+interface PrefSwitchSurveyField {
9090
9191 /* Static Methods */
92 -
 92+
9393 /**
9494 * Render the HTML for a question
9595 * @param $question string Question ID
@@ -98,7 +98,7 @@
9999 * @return string HTML
100100 */
101101 public static function render( $question, $config, $answer, $answerData );
102 -
 102+
103103 /**
104104 * Get values to insert into the database for a question
105105 * @param $question Question ID
@@ -142,7 +142,7 @@
143143 $html .= Xml::closeElement( 'dd' );
144144 return $html;
145145 }
146 -
 146+
147147 public static function save( $question, $request ) {
148148 $answer = $request->getVal( "prefswitch-survey-{$question}", '' );
149149 switch ( $answer ) {
Index: trunk/extensions/FlaggedRevs/api/actions/ApiReview.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -/*
 4+/**
55 * Created on Dec 20, 2008
66 *
77 * API module for MediaWiki's FlaggedRevs extension
@@ -132,14 +132,14 @@
133133 $this->dieUsage( "Provided page is not reviewable.", 'notreviewable' );
134134 } elseif ( $status === 'review_page_notexists' ) {
135135 $this->dieUsage( "Provided page does not exist.", 'notarget' );
136 - }
 136+ }
137137 }
138138 }
139139
140140 public function mustBePosted() {
141141 return true;
142142 }
143 -
 143+
144144 public function isWriteMode() {
145145 return true;
146146 }
Index: trunk/extensions/FlaggedRevs/api/actions/ApiStabilize.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -/*
 4+/**
55 * Created on Sep 19, 2009
66 *
77 * API module for MediaWiki's FlaggedRevs extension
Index: trunk/extensions/FlaggedRevs/api/actions/ApiReviewActivity.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -/*
 4+/**
55 * Created on June 13, 2011
66 *
77 * API module for MediaWiki's FlaggedRevs extension
Index: trunk/extensions/FlaggedRevs/api/reports/ApiFlagConfig.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -/*
 4+/**
55 * Created on November 6, 2009
66 *
77 * API module for MediaWiki's FlaggedRevs extension
@@ -50,7 +50,7 @@
5151 public function mustBePosted() {
5252 return false;
5353 }
54 -
 54+
5555 public function isWriteMode() {
5656 return false;
5757 }
@@ -58,7 +58,7 @@
5959 public function getAllowedParams() {
6060 return array();
6161 }
62 -
 62+
6363 public function getParamDescription() {
6464 return array();
6565 }
@@ -79,7 +79,7 @@
8080 public function getExamples() {
8181 return 'api.php?action=flagconfig';
8282 }
83 -
 83+
8484 public function getVersion() {
8585 return __CLASS__ . ': $Id$';
8686 }
Index: trunk/extensions/FlaggedRevs/api/reports/ApiQueryFlagged.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -/*
 4+/**
55 * Created on Sep 17, 2008
66 *
77 * API module for MediaWiki's FlaggedRevs extension
@@ -34,7 +34,7 @@
3535 if ( !$pageids ) {
3636 return true;
3737 }
38 -
 38+
3939 // Construct SQL Query
4040 $this->addTables( 'flaggedpages' );
4141 $this->addFields( array(
@@ -82,7 +82,7 @@
8383 'api.php?action=query&generator=allpages&gapfrom=K&prop=flagged'
8484 );
8585 }
86 -
 86+
8787 public function getVersion() {
8888 return __CLASS__ . ': $Id$';
8989 }
Index: trunk/extensions/FlaggedRevs/api/reports/ApiQueryOldreviewedpages.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -/*
 4+/**
55 * Created on Sep 17, 2008
66 *
77 * API module for MediaWiki's FlaggedRevs extension
@@ -240,7 +240,7 @@
241241 ' api.php?action=query&generator=oldreviewedpages&gorlimit=4&prop=info',
242242 );
243243 }
244 -
 244+
245245 public function getVersion() {
246246 return __CLASS__ . ': $Id$';
247247 }
Index: trunk/extensions/FlaggedRevs/api/reports/ApiQueryReviewedpages.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -/*
 4+/**
55 * Created on June 29, 2009
66 *
77 * API module for MediaWiki's FlaggedRevs extension
@@ -198,7 +198,7 @@
199199 ' api.php?action=query&generator=reviewedpages&grplimit=4&prop=info',
200200 );
201201 }
202 -
 202+
203203 public function getVersion() {
204204 return __CLASS__ . ': $Id$';
205205 }
Index: trunk/extensions/FlaggedRevs/api/reports/ApiQueryUnreviewedpages.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -/*
 4+/**
55 * Created on June 29, 2009
66 *
77 * API module for MediaWiki's FlaggedRevs extension
@@ -182,7 +182,7 @@
183183 ' api.php?action=query&generator=unreviewedpages&urnamespace=0&gurlimit=4&prop=info',
184184 );
185185 }
186 -
 186+
187187 public function getVersion() {
188188 return __CLASS__ . ': $Id$';
189189 }
Index: trunk/extensions/FlaggedRevs/api/reports/ApiQueryConfiguredPages.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -/*
 4+/**
55 * Created on April 8, 2011
66 *
77 * API module for MediaWiki's FlaggedRevs extension
Index: trunk/extensions/Collection/Collection.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -/*
 4+/**
55 * Collection Extension for MediaWiki
66 *
77 * Copyright (C) PediaPress GmbH
Index: trunk/extensions/Collection/Collection.suggest.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -/*
 4+/**
55 * Collection Extension for MediaWiki
66 *
77 * Copyright (C) 2008-2009, PediaPress GmbH
@@ -21,7 +21,7 @@
2222 * http://www.gnu.org/copyleft/gpl.html
2323 */
2424
25 -/*
 25+/**
2626 * Class: CollectionSuggest
2727 *
2828 * This class contains only static methods, so theres no need for a constructer.
@@ -215,9 +215,9 @@
216216 }
217217 }
218218
219 -/*
 219+/**
220220 * class: Proposals
221 - *
 221+ *
222222 * it needs 3 Lists:
223223 * - one with the bookmembers
224224 * - one where it can save the banned articles
@@ -229,8 +229,8 @@
230230 * links of that article as second dimension can be accessed with the method
231231 * getLinkList()
232232 *
233 - *
234233 *
 234+ *
235235 * the Class can only sort the proposals, if it can access the function compareProps
236236 */
237237 class Proposals {
@@ -240,20 +240,20 @@
241241 * class attributes
242242 * ==================================================
243243 *
244 - * only mLinkList and mPropList can be accessed from
 244+ * only mLinkList and mPropList can be accessed from
245245 * outside the class via getLinkList() and getPropsosals()
246246 */
247247 private $mColl;
248248 private $mPropList;
249249 private $mLinkList;
250250 private $mBanList;
251 -
 251+
252252 /*
253253 * ==================================================
254254 * constructor
255255 * ==================================================
256 - *
257 - * @param $coll the collection
 256+ *
 257+ * @param $coll the collection
258258 * @param $ban the list of the banned articles
259259 * @param $props the lilst of the proposals
260260 */
@@ -291,7 +291,7 @@
292292 * default is true
293293 * @return a 2-dimensional array that contains the proposals
294294 * the first dimesion is numeric, the second contains
295 - * 3 entries:
 295+ * 3 entries:
296296 * - 'name': the name of a proposed article
297297 * - 'num' : how often this artikel was linked in the
298298 * bookmembers
@@ -302,7 +302,7 @@
303303 if ( $doUpdate ) {
304304 $this->updateLinkList();
305305 }
306 -
 306+
307307 $this->getPropList();
308308
309309 if ( $num > 0 ) {
@@ -405,7 +405,7 @@
406406 if ( preg_match( '/[:#]/', $link ) ) { // skip links with ':' and '#'
407407 continue;
408408 }
409 -
 409+
410410 // handle links with a displaytitle
411411 $matches = array();
412412 if ( preg_match( '/(.+?)\|(.+)/', $link, $matches ) ) {
@@ -456,7 +456,7 @@
457457 }
458458 }
459459 }
460 -
 460+
461461 if ( count( $linkcount ) == 0 ) {
462462 return array();
463463 }
@@ -570,10 +570,10 @@
571571 }
572572 }
573573
574 -/*
 574+/**
575575 * sort $mPropList by the entries values
576576 * sort alphabetically by equal values
577 - *
 577+ *
578578 * @param $a, $b: arrays that contain two entries
579579 * the keys: 'name' & 'val'
580580 * 'name': an articlename
Index: trunk/extensions/Collection/Collection.hooks.php
@@ -1,5 +1,5 @@
22 <?php
3 -/*
 3+/**
44 * Collection Extension for MediaWiki
55 *
66 * Copyright (C) PediaPress GmbH
Index: trunk/extensions/Collection/Collection.session.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -/*
 4+/**
55 * Collection Extension for MediaWiki
66 *
77 * Copyright (C) PediaPress GmbH
Index: trunk/extensions/Collection/Collection.body.php
@@ -1,5 +1,5 @@
22 <?php
3 -/*
 3+/**
44 * Collection Extension for MediaWiki
55 *
66 * Copyright (C) PediaPress GmbH
@@ -1050,8 +1050,8 @@
10511051
10521052 $template = new CollectionRenderingTemplate();
10531053 $template->set( 'status', $status );
1054 - if ( !isset( $response['status']['progress'] ) ) {
1055 - $response['status']['progress'] = 1.00;
 1054+ if ( !isset( $response['status']['progress'] ) ) {
 1055+ $response['status']['progress'] = 1.00;
10561056 }
10571057 $template->set( 'progress', $response['status']['progress'] );
10581058 $wgOut->addTemplate( $template );
@@ -1073,13 +1073,13 @@
10741074
10751075 function download() {
10761076 global $wgOut, $wgRequest, $wgCollectionContentTypeToFilename;
1077 -
 1077+
10781078 $tempfile = tmpfile();
10791079 $r = self::mwServeCommand( 'render_status', array(
10801080 'collection_id' => $wgRequest->getVal( 'collection_id' ),
10811081 'writer' => $wgRequest->getVal( 'writer' ),
10821082 ) );
1083 -
 1083+
10841084 $info = false;
10851085 if ( isset( $r['url'] ) ) {
10861086 $result = Http::get( $r['url'] );
Index: trunk/extensions/Collection/Collection.templates.php
@@ -293,7 +293,7 @@
294294 <input name="append" type="submit" value="<?php $this->msg( 'coll-append' ) ?>" />
295295 <input name="cancel" type="submit" value="<?php $this->msg( 'coll-cancel' ) ?>" />
296296 <input name="bookcmd" type="hidden" value="load_collection" />
297 - <input name="colltitle" type="hidden" value="<?php echo htmlspecialchars( $this->data['title']->getPrefixedText() ) ?>" />
 297+ <input name="colltitle" type="hidden" value="<?php echo htmlspecialchars( $this->data['title']->getPrefixedText() ) ?>" />
298298 </form>
299299
300300 <?php
@@ -399,9 +399,9 @@
400400 }
401401 }
402402
403 -/*
 403+/**
404404 * Template for suggest feature
405 - *
 405+ *
406406 * It needs the two methods getProposalList() and getMemberList()
407407 * to run with Ajax
408408 */
@@ -451,7 +451,7 @@
452452
453453 $prop = $this->data['proposals'];
454454 $out = '';
455 -
 455+
456456 $num = count( $prop );
457457 if ( $num == 0 ) {
458458 return "<li>" . wfMsgHtml( 'coll-suggest_empty' ) . "</li>";
Index: trunk/extensions/WikimediaMaintenance/cleanupTitles64966.php
@@ -1,5 +1,5 @@
22 <?php
3 -/*
 3+/**
44 * Script to clean up broken, unparseable titles.
55 *
66 * Usage: php cleanupTitles.php [--fix]
@@ -42,7 +42,7 @@
4343 $verified = $wgContLang->normalize( $display );
4444 $title = Title::newFromText( $verified );
4545
46 - if( !is_null( $title )
 46+ if( !is_null( $title )
4747 && $title->canExist()
4848 && $title->getNamespace() == $row->page_namespace
4949 && $title->getDBkey() === $row->page_title )
@@ -114,7 +114,7 @@
115115 }
116116
117117 # Old cleanupTitles could move articles there. See bug 23147.
118 - $ns = $row->page_namespace;
 118+ $ns = $row->page_namespace;
119119 if ( $ns < 0) $ns = 0;
120120
121121 $clean = 'Broken/' . $prior;
Index: trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -/*
 4+/**
55 * Created on Oct 13, 2006
66 * Adapted to XML output variant, plus extra text extraction 2008
77 * Text extraction adapted from ActiveAbstract extension.
Index: trunk/extensions/OpenSearchXml/OpenSearchXml.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -/*
 4+/**
55 * Copyright (C) 2008 Brion Vibber <brion@wikimedia.org>
66 * http://www.mediawiki.org/
77 *
Index: trunk/extensions/Wikimania/Wikimania.php
@@ -1,5 +1,5 @@
22 <?php
3 -/*
 3+/**
44 * Extension for managing the Wikimania conferences
55 */
66
Index: trunk/extensions/Wikimania/specials/SpecialCheckWikimaniaStatus.php
@@ -1,5 +1,5 @@
22 <?php
3 -/*
 3+/**
44 * Check your registration status
55 */
66 class SpecialCheckWikimaniaStatus extends SpecialPage {
Index: trunk/extensions/Wikimania/specials/SpecialRegisterForWikimania.php
@@ -1,5 +1,5 @@
22 <?php
3 -/*
 3+/**
44 * Register for Wikimania
55 */
66 class SpecialRegisterForWikimania extends SpecialPage {
Index: trunk/extensions/Wikimania/backend/Wikimania.php
@@ -45,7 +45,6 @@
4646 */
4747 private $country;
4848
49 -
5049 /**
5150 * Do a bit of delayed setup, based on this year's config
5251 * @param $year int Year to host Wikimania for
Index: trunk/extensions/Wikimania/backend/WikimaniaRegistration.php
@@ -3,15 +3,29 @@
44 * Class referring to a specific registration
55 */
66 class WikimaniaRegistration extends HTMLForm {
 7+
 8+ /**
 9+ * @param $wm Wikimania
 10+ * @param $context ContextSource
 11+ */
712 public function __construct( Wikimania $wm, $context = null ) {
813 parent::__construct( $this->getFields( $wm, $context->getUser() ), $context, 'wikimania' );
914 }
1015
 16+ /**
 17+ * @param $u user
 18+ * @return string
 19+ */
1120 public static function generateRegistrationID( User $u ) {
1221 $str = $u->getName() . ":" . microtime() . ":" . wfGetIP();
1322 return substr( sha1( $str ), 0, 5 );
1423 }
1524
 25+ /**
 26+ * @param $wm Wikimania
 27+ * @param $u User
 28+ * @return array
 29+ */
1630 private function getFields( Wikimania $wm, User $u ) {
1731 static $fields;
1832 if( !$fields ) {
@@ -76,6 +90,10 @@
7791 return $fields;
7892 }
7993
 94+ /**
 95+ * @static
 96+ * @return array
 97+ */
8098 private static function getGenderPossibilities() {
8199 return array(
82100 wfMsg( 'gender-male') => 'male',

Comments

#Comment by Hashar (talk | contribs)   08:53, 23 November 2011

Is that needed / enforced by Doxygen?

#Comment by Nikerabbit (talk | contribs)   10:30, 23 November 2011

It doesn't enforce, it just doesn't pick up them as documentation without ///.

Status & tagging log