r64586 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64585‎ | r64586 | r64587 >
Date:23:13, 3 April 2010
Author:siebrand
Status:deferred
Tags:
Comment:
stylize.php, trailing whitespace removed
Modified paths:
  • /trunk/extensions/AssertEdit/ApiAssertEdit.php (modified) (history)
  • /trunk/extensions/AssertEdit/AssertEdit.php (modified) (history)
  • /trunk/extensions/AssertEdit/AssertEdit_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AssertEdit/ApiAssertEdit.php
@@ -5,7 +5,7 @@
66 }
77
88 class ApiAssertEdit extends ApiBase {
9 -
 9+
1010 public function __construct( $main, $action ) {
1111 parent::__construct( $main, $action );
1212 }
@@ -13,15 +13,15 @@
1414 public function execute() {
1515 $this->dieUsage( '', 'assertedit' );
1616 }
17 -
 17+
1818 public function getDescription() {
1919 return 'Allows bots to make assertions. Can only be used during of editing';
2020 }
21 -
 21+
2222 public function isReadMode() {
2323 return false;
2424 }
25 -
 25+
2626 public function shouldCheckMaxlag() {
2727 return false;
2828 }
@@ -36,7 +36,7 @@
3737 'test' => 'Verify that this wiki allows random testing. Defaults to false, but can be overridden in LocalSettings.php.'
3838 );
3939 }
40 -
 40+
4141 public function getPossibleErrors() {
4242 return array();
4343 }
Index: trunk/extensions/AssertEdit/AssertEdit_body.php
@@ -24,20 +24,20 @@
2525 * List of assertions; can be modified with setAssert
2626 */
2727 static private $msAssert = array(
28 - //simple constants, i.e. to test if the extension is installed.
 28+ // simple constants, i.e. to test if the extension is installed.
2929 'true' => true,
3030 'false' => false,
31 - //useful variable tests, to ensure we stay logged in
 31+ // useful variable tests, to ensure we stay logged in
3232 'user' => array( 'AssertEdit', 'assert_user' ),
3333 'bot' => array( 'AssertEdit', 'assert_bot' ),
3434 'exists' => array( 'AssertEdit', 'assert_exists' ),
35 - //override these in LocalSettings.php
36 - //'wikimedia' => false, //is this an offical wikimedia site?
37 - 'test' => false //Do we allow random tests?
 35+ // override these in LocalSettings.php
 36+ // 'wikimedia' => false, //is this an offical wikimedia site?
 37+ 'test' => false // Do we allow random tests?
3838 );
3939
4040 static function setAssert( $key, $value ) {
41 - //Don't confuse things by changing core assertions.
 41+ // Don't confuse things by changing core assertions.
4242 switch ( $key ) {
4343 case 'true':
4444 case 'false':
@@ -46,7 +46,7 @@
4747 case 'exists':
4848 return false;
4949 }
50 - //make sure it's useable.
 50+ // make sure it's useable.
5151 if ( is_bool( $value ) || is_callable( $value ) ) {
5252 self::$msAssert[$key] = $value;
5353 return true;
@@ -55,7 +55,7 @@
5656 }
5757 }
5858
59 - //call the specified assertion
 59+ // call the specified assertion
6060 static function callAssert( $assertName, $negate ) {
6161 if ( isset( self::$msAssert[$assertName] ) ) {
6262 if ( is_bool( self::$msAssert[$assertName] ) ) {
@@ -68,10 +68,9 @@
6969 $pass = !$pass;
7070 }
7171 } else {
72 - //unrecognized assert fails, regardless of negation.
 72+ // unrecognized assert fails, regardless of negation.
7373 $pass = false;
7474 }
7575 return $pass;
7676 }
77 -
7877 }
Index: trunk/extensions/AssertEdit/AssertEdit.php
@@ -1,5 +1,4 @@
22 <?php
3 -
43 if ( ! defined( 'MEDIAWIKI' ) )
54 die();
65 /**#@+
@@ -25,7 +24,7 @@
2625 'url' => 'http://www.mediawiki.org/wiki/Extension:Assert_Edit',
2726 );
2827
29 -$dir = dirname(__FILE__) . '/';
 28+$dir = dirname( __FILE__ ) . '/';
3029 $wgExtensionMessagesFiles['AssertEdit'] = $dir . 'AssertEdit.i18n.php';
3130 $wgAutoloadClasses['AssertEdit'] = $dir . 'AssertEdit_body.php';
3231 $wgHooks['AlternateEdit'][] = 'efAssertEditHook';
@@ -44,7 +43,7 @@
4544 $pass = AssertEdit::callAssert( $assertName, false );
4645 }
4746
48 - //check for negative assert
 47+ // check for negative assert
4948 if ( $pass ) {
5049 $assertName = $wgRequest->getVal( 'nassert' );
5150 if ( $assertName != '' ) {
@@ -57,7 +56,7 @@
5857 } else {
5958 wfLoadExtensionMessages( 'AssertEdit' );
6059
61 - //slightly modified from showErrorPage(), to return back here.
 60+ // slightly modified from showErrorPage(), to return back here.
6261 $wgOut->setPageTitle( wfMsg( 'assert_edit_title' ) );
6362 $wgOut->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
6463 $wgOut->setRobotPolicy( 'noindex,nofollow' );
@@ -72,6 +71,7 @@
7372 return false;
7473 }
7574 }
 75+
7676 function efAssertApiEditHook( $editPage, $textBox, &$result ) {
7777 global $wgOut, $wgRequest;
7878
@@ -80,11 +80,11 @@
8181
8282 if ( $assertName != '' ) {
8383 $pass = AssertEdit::callAssert( $assertName, false );
84 - if ( !$pass )
 84+ if ( !$pass )
8585 $result['assert'] = $assertName;
8686 }
8787
88 - //check for negative assert
 88+ // check for negative assert
8989 if ( $pass ) {
9090 $assertName = $wgRequest->getVal( 'nassert' );
9191 if ( $assertName != '' ) {

Status & tagging log