r85409 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85408‎ | r85409 | r85410 >
Date:00:46, 5 April 2011
Author:aaron
Status:ok
Tags:
Comment:
* Removed excess entry point guards
* Assorted doc comment cleanups
* Brace cleanups
Modified paths:
  • /trunk/extensions/FlaggedRevs/FRDependencyUpdate.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FRUserActivity.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/business/PageStabilityForm.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/business/RevisionReviewForm.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/RejectConfirmationFormGUI.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/RevisionReviewFormGUI.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ConfiguredPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/PendingChanges_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ReviewedPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ReviewedVersions_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ValidationStatistics_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/updater/FlaggedRevsUpdater.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php
@@ -302,7 +302,7 @@
303303 /**
304304 * Get visiblity restrictions on page
305305 * @param int $flags, FR_MASTER
306 - * @return array (select,override)
 306+ * @return Array (select,override)
307307 */
308308 public function getStabilitySettings( $flags = 0 ) {
309309 $this->loadFlaggedRevsData( $flags );
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -471,7 +471,7 @@
472472 * @param Title $title
473473 * @param string $text wikitext
474474 * @param int $id Source revision Id
475 - * @return array( string wikitext, array of template versions )
 475+ * @return Array( string wikitext, array of template versions )
476476 */
477477 public static function expandText( Title $title, $text, $id ) {
478478 global $wgParser;
@@ -1075,7 +1075,7 @@
10761076 /**
10771077 * Get minimum level tags for a tier
10781078 * @param int $tier FR_PRISTINE/FR_QUALITY/FR_CHECKED
1079 - * @return array
 1079+ * @return Array
10801080 */
10811081 public static function quickTags( $tier ) {
10821082 self::load();
@@ -1117,7 +1117,7 @@
11181118
11191119 /**
11201120 * Get the list of reviewable namespaces
1121 - * @return array
 1121+ * @return Array
11221122 */
11231123 public static function getReviewNamespaces() {
11241124 self::load(); // validates namespaces
@@ -1126,7 +1126,7 @@
11271127
11281128 /**
11291129 * Get the list of patrollable namespaces
1130 - * @return array
 1130+ * @return Array
11311131 */
11321132 public static function getPatrolNamespaces() {
11331133 self::load(); // validates namespaces
Index: trunk/extensions/FlaggedRevs/business/RevisionReviewForm.php
@@ -1,9 +1,4 @@
22 <?php
3 -# (c) Aaron Schulz 2010 GPL
4 -if ( !defined( 'MEDIAWIKI' ) ) {
5 - echo "FlaggedRevs extension\n";
6 - exit( 1 );
7 -}
83 /**
94 * Class containing revision review form business logic
105 * Note: edit tokens are the responsibility of caller
@@ -11,8 +6,7 @@
127 * (b) call ready() when all params are set
138 * (c) call submit() as needed
149 */
15 -class RevisionReviewForm
16 -{
 10+class RevisionReviewForm {
1711 /* Form parameters which can be user given */
1812 protected $page = null;
1913 protected $approve = false;
@@ -37,7 +31,7 @@
3832 public function __construct( User $user ) {
3933 $this->user = $user;
4034 foreach ( FlaggedRevs::getTags() as $tag ) {
41 - $this->dims[$tag] = 0;
 35+ $this->dims[$tag] = 0; // default to "inadequate"
4236 }
4337 }
4438
@@ -339,9 +333,7 @@
340334 }
341335 # Watch page if set to do so
342336 if ( $status === true ) {
343 - if ( $this->user->getOption( 'flaggedrevswatch' )
344 - && !$this->page->userIsWatching() )
345 - {
 337+ if ( $this->user->getOption( 'flaggedrevswatch' ) && !$this->page->userIsWatching() ) {
346338 $this->user->addWatch( $this->page );
347339 }
348340 }
Index: trunk/extensions/FlaggedRevs/business/PageStabilityForm.php
@@ -1,9 +1,4 @@
22 <?php
3 -# (c) Aaron Schulz 2010 GPL
4 -if ( !defined( 'MEDIAWIKI' ) ) {
5 - echo "FlaggedRevs extension\n";
6 - exit( 1 );
7 -}
83 /**
94 * Class containing stability settings form business logic
105 * Note: edit tokens are the responsibility of caller
@@ -11,8 +6,7 @@
127 * (b) call ready() when all params are set
138 * (c) call preloadSettings() or submit() as needed
149 */
15 -abstract class PageStabilityForm
16 -{
 10+abstract class PageStabilityForm {
1711 /* Form parameters which can be user given */
1812 protected $page = false; # Target page obj
1913 protected $watchThis = null; # Watch checkbox
@@ -33,6 +27,10 @@
3428 $this->user = $user;
3529 }
3630
 31+ public function getUser() {
 32+ return $this->user;
 33+ }
 34+
3735 public function getPage() {
3836 return $this->page;
3937 }
@@ -377,7 +375,7 @@
378376
379377 /*
380378 * Get assoc. array of log params
381 - * @return array
 379+ * @return Array
382380 */
383381 protected function getLogParams() {
384382 return array();
Index: trunk/extensions/FlaggedRevs/FRDependencyUpdate.php
@@ -76,7 +76,7 @@
7777 /*
7878 * Get existing cache dependancies
7979 * @param int $flags FR_MASTER
80 - * @return array (ns => dbKey => 1)
 80+ * @return Array (ns => dbKey => 1)
8181 */
8282 protected function getExistingDeps( $flags = 0 ) {
8383 $db = ( $flags & FR_MASTER ) ?
@@ -98,7 +98,7 @@
9999
100100 /*
101101 * Get INSERT rows for cache dependancies in $new but not in $existing
102 - * @return array
 102+ * @return Array
103103 */
104104 protected function getDepInsertions( array $existing, array $new ) {
105105 $arr = array();
@@ -157,7 +157,7 @@
158158
159159 /**
160160 * Get an array of existing links, as a 2-D array
161 - * @return array (ns => dbKey => 1)
 161+ * @return Array (ns => dbKey => 1)
162162 */
163163 protected function getCurrentVersionLinks() {
164164 $dbr = wfGetDB( DB_SLAVE );
@@ -178,7 +178,7 @@
179179
180180 /**
181181 * Get an array of existing templates, as a 2-D array
182 - * @return array (ns => dbKey => 1)
 182+ * @return Array (ns => dbKey => 1)
183183 */
184184 protected function getCurrentVersionTemplates() {
185185 $dbr = wfGetDB( DB_SLAVE );
@@ -199,7 +199,7 @@
200200
201201 /**
202202 * Get an array of existing images, image names in the keys
203 - * @return array (dbKey => 1)
 203+ * @return Array (dbKey => 1)
204204 */
205205 protected function getCurrentVersionImages() {
206206 $dbr = wfGetDB( DB_SLAVE );
@@ -217,7 +217,7 @@
218218
219219 /**
220220 * Get an array of existing categories, with the name in the key and sort key in the value.
221 - * @return array (category => sortkey)
 221+ * @return Array (category => sortkey)
222222 */
223223 protected function getCurrentVersionCategories() {
224224 $dbr = wfGetDB( DB_SLAVE );
Index: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php
@@ -1,12 +1,7 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ) {
4 - echo "FlaggedRevs extension\n";
5 - exit( 1 );
6 -}
73
84 // Assumes $wgFlaggedRevsProtection is off
9 -class Stabilization extends UnlistedSpecialPage
10 -{
 5+class Stabilization extends UnlistedSpecialPage {
116 protected $form = null;
127 protected $skin;
138
Index: trunk/extensions/FlaggedRevs/specialpages/PendingChanges_body.php
@@ -1,11 +1,6 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ) {
4 - echo "FlaggedRevs extension\n";
5 - exit( 1 );
6 -}
73
8 -class PendingChanges extends SpecialPage
9 -{
 4+class PendingChanges extends SpecialPage {
105 protected $pager = null;
116
127 public function __construct() {
Index: trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php
@@ -1,11 +1,6 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ) {
4 - echo "FlaggedRevs extension\n";
5 - exit( 1 );
6 -}
73
8 -class UnreviewedPages extends SpecialPage
9 -{
 4+class UnreviewedPages extends SpecialPage {
105 protected $pager = null;
116
127 public function __construct() {
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php
@@ -1,13 +1,6 @@
22 <?php
3 -# (c) Aaron Schulz, Joerg Baach, 2007 GPL
43
5 -if ( !defined( 'MEDIAWIKI' ) ) {
6 - echo "FlaggedRevs extension\n";
7 - exit( 1 );
8 -}
9 -
10 -class RevisionReview extends UnlistedSpecialPage
11 -{
 4+class RevisionReview extends UnlistedSpecialPage {
125 protected $form;
136 protected $page;
147 var $skin; // FIXME: with RevDel_RevisionList stuff
Index: trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php
@@ -1,11 +1,6 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ) {
4 - echo "FlaggedRevs extension\n";
5 - exit( 1 );
6 -}
73
8 -class QualityOversight extends SpecialPage
9 -{
 4+class QualityOversight extends SpecialPage {
105 public function __construct() {
116 parent::__construct( 'QualityOversight' );
127 }
Index: trunk/extensions/FlaggedRevs/specialpages/ReviewedVersions_body.php
@@ -1,11 +1,6 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ) {
4 - echo "FlaggedRevs extension\n";
5 - exit( 1 );
6 -}
73
8 -class ReviewedVersions extends UnlistedSpecialPage
9 -{
 4+class ReviewedVersions extends UnlistedSpecialPage {
105 public function __construct() {
116 parent::__construct( 'ReviewedVersions' );
127 }
Index: trunk/extensions/FlaggedRevs/specialpages/ConfiguredPages_body.php
@@ -1,12 +1,7 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ) {
4 - echo "FlaggedRevs extension\n";
5 - exit( 1 );
6 -}
73
84 // Assumes $wgFlaggedRevsProtection is off
9 -class ConfiguredPages extends SpecialPage
10 -{
 5+class ConfiguredPages extends SpecialPage {
116 protected $pager = null;
127
138 public function __construct() {
Index: trunk/extensions/FlaggedRevs/specialpages/ValidationStatistics_body.php
@@ -1,11 +1,6 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ) {
4 - echo "FlaggedRevs extension\n";
5 - exit( 1 );
6 -}
73
8 -class ValidationStatistics extends IncludableSpecialPage
9 -{
 4+class ValidationStatistics extends IncludableSpecialPage {
105 public function __construct() {
116 parent::__construct( 'ValidationStatistics' );
127 }
Index: trunk/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php
@@ -1,11 +1,6 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ) {
4 - echo "FlaggedRevs extension\n";
5 - exit( 1 );
6 -}
73
8 -class ProblemChanges extends SpecialPage
9 -{
 4+class ProblemChanges extends SpecialPage {
105 protected $pager = null;
116
127 public function __construct() {
Index: trunk/extensions/FlaggedRevs/specialpages/ReviewedPages_body.php
@@ -1,11 +1,6 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ) {
4 - echo "FlaggedRevs extension\n";
5 - exit( 1 );
6 -}
73
8 -class ReviewedPages extends SpecialPage
9 -{
 4+class ReviewedPages extends SpecialPage {
105 protected $pager = null;
116
127 public function __construct() {
Index: trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php
@@ -1,12 +1,7 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ) {
4 - echo "FlaggedRevs extension\n";
5 - exit( 1 );
6 -}
73
84 // Assumes $wgFlaggedRevsProtection is on
9 -class StablePages extends SpecialPage
10 -{
 5+class StablePages extends SpecialPage {
116 protected $pager = null;
127
138 public function __construct() {
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -1,8 +1,4 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ) {
4 - echo "FlaggedRevs extension\n";
5 - exit( 1 );
6 -}
73 /**
84 * Class containing hooked functions for a FlaggedRevs environment
95 */
Index: trunk/extensions/FlaggedRevs/updater/FlaggedRevsUpdater.hooks.php
@@ -1,8 +1,4 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ) {
4 - echo "FlaggedRevs extension\n";
5 - exit( 1 );
6 -}
73 /**
84 * Class containing updater functions for a FlaggedRevs environment
95 */
Index: trunk/extensions/FlaggedRevs/FRUserActivity.php
@@ -42,7 +42,7 @@
4343 /*
4444 * Get who is currently reviewing a page
4545 * @param int $pageId
46 - * @return array (username or null, MW timestamp or null)
 46+ * @return Array (username or null, MW timestamp or null)
4747 */
4848 public static function getUserReviewingPage( $pageId ) {
4949 global $wgMemc;
@@ -99,7 +99,7 @@
100100 * Get who is currently reviewing a diff
101101 * @param int $oldId
102102 * @param int $newId
103 - * @return array (username or null, MW timestamp or null)
 103+ * @return Array (username or null, MW timestamp or null)
104104 */
105105 public static function getUserReviewingDiff( $oldId, $newId ) {
106106 global $wgMemc;
Index: trunk/extensions/FlaggedRevs/presentation/RevisionReviewFormGUI.php
@@ -1,9 +1,4 @@
22 <?php
3 -# (c) Aaron Schulz 2011 GPL
4 -if ( !defined( 'MEDIAWIKI' ) ) {
5 - echo "FlaggedRevs extension\n";
6 - exit( 1 );
7 -}
83 /**
94 * Main review form UI
105 *
Index: trunk/extensions/FlaggedRevs/presentation/RejectConfirmationFormGUI.php
@@ -1,9 +1,4 @@
22 <?php
3 -# (c) Aaron Schulz 2011 GPL
4 -if ( !defined( 'MEDIAWIKI' ) ) {
5 - echo "FlaggedRevs extension\n";
6 - exit( 1 );
7 -}
83 /**
94 * Reject confirmation review form UI
105 */
@@ -17,11 +12,7 @@
1813 }
1914
2015 /**
21 - * Output the "are you sure you want to reject this" form
22 - *
23 - * A bit hacky, but we don't have a way to pass more complicated
24 - * UI things back up, since RevisionReview expects either true
25 - * or a string message key
 16+ * Get the "are you sure you want to reject these changes?" form
2617 * @return Array (html string, error string or true)
2718 */
2819 public function getHtml() {

Status & tagging log