r104450 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104449‎ | r104450 | r104451 >
Date:16:00, 28 November 2011
Author:reedy
Status:ok
Tags:
Comment:
Documentation

Trim whitespace

Remove unreachable statement
Modified paths:
  • /trunk/extensions/APC/SpecialAPC.php (modified) (history)
  • /trunk/extensions/ApiSandbox/ext.apiSandbox.js (modified) (history)
  • /trunk/extensions/AssertEdit/AssertEdit.php (modified) (history)
  • /trunk/extensions/ShortUrl/ShortUrl.hooks.php (modified) (history)
  • /trunk/extensions/ShortUrl/ShortUrl.php (modified) (history)
  • /trunk/extensions/Video/SpecialAddVideo.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AssertEdit/AssertEdit.php
@@ -33,6 +33,10 @@
3434 $wgHooks['APIGetAllowedParams'][] = 'efAssertApiEditGetAllowedParams';
3535 $wgHooks['APIGetParamDescription'][] = 'efAssertApiEditGetParamDescription';
3636
 37+/**
 38+ * @param $editpage EditPage
 39+ * @return bool
 40+ */
3741 function efAssertEditHook( $editpage ) {
3842 global $wgOut, $wgRequest;
3943
@@ -70,6 +74,12 @@
7175 }
7276 }
7377
 78+/**
 79+ * @param $editPage EditPage
 80+ * @param $textBox
 81+ * @param $result array
 82+ * @return bool|mixed
 83+ */
7484 function efAssertApiEditHook( $editPage, $textBox, &$result ) {
7585 global $wgRequest;
7686
@@ -93,10 +103,15 @@
94104 $result['nassert'] = $assertName;
95105 }
96106 }
97 -
 107+
98108 return $pass;
99109 }
100 -
 110+
 111+/**
 112+ * @param $module ApiBase
 113+ * @param $params array
 114+ * @return bool
 115+ */
101116 function efAssertApiEditGetAllowedParams( &$module, &$params ) {
102117 if ( !$module instanceof ApiEditPage ) {
103118 return true;
@@ -108,7 +123,12 @@
109124
110125 return true;
111126 }
112 -
 127+
 128+/**
 129+ * @param $module ApiBase
 130+ * @param $desc array
 131+ * @return bool
 132+ */
113133 function efAssertApiEditGetParamDescription( &$module, &$desc ) {
114134 if ( !$module instanceof ApiEditPage ) {
115135 return true;
Index: trunk/extensions/Video/SpecialAddVideo.php
@@ -53,7 +53,6 @@
5454 // If user is blocked, s/he doesn't need to access this page
5555 if( $this->getUser()->isBlocked() ) {
5656 throw new UserBlockedError( $this->getUser()->mBlock );
57 - return false;
5857 }
5958
6059 $this->setHeaders();
Index: trunk/extensions/ApiSandbox/ext.apiSandbox.js
@@ -41,7 +41,7 @@
4242 setHelp: function( $container ) {
4343 var desc = smartEscape( this.info.description );
4444 if ( isset( this.info.helpurls ) && isset( this.info.helpurls[0] ) && this.info.helpurls[0] ) {
45 - desc = desc.replace( /^([^\r\n\.]*)/,
 45+ desc = desc.replace( /^([^\r\n\.]*)/,
4646 '<a target="_blank" href="' + mw.html.escape( this.info.helpurls[0] ) + '">$1</a>'
4747 );
4848 }
@@ -138,7 +138,7 @@
139139 if ( !$content.length ) {
140140 return;
141141 }
142 - $content.show();
 142+ $content.show();
143143
144144 // page elements
145145 var $format = $( '#api-sandbox-format' ),
@@ -205,7 +205,7 @@
206206
207207 $action.change( updateUI );
208208 $query.change( updateUI );
209 -
 209+
210210 $( '#param-generator' ).live( 'change', function() {
211211 var generator = $( '#param-generator' ).val();
212212 if ( generator == '' ) {
@@ -294,7 +294,7 @@
295295
296296 function showLoading( $element ) {
297297 $element.html(
298 - mw.html.element( 'img',
 298+ mw.html.element( 'img',
299299 { src: mw.config.get( 'stylepath' ) + '/common/images/spinner.gif', alt: '' } )
300300 + mw.html.escape( mw.msg( 'apisb-loading' ) ) );
301301 }
Index: trunk/extensions/APC/SpecialAPC.php
@@ -5,7 +5,16 @@
66
77 // Stored objects
88
9 - protected $opts, $title;
 9+ /**
 10+ * @var FormOptions
 11+ */
 12+ protected $opts;
 13+
 14+ /**
 15+ * @var Title
 16+ */
 17+ protected $title;
 18+
1019 function __construct() {
1120 parent::__construct( 'APC' );
1221 $this->title = $this->getTitle();
Index: trunk/extensions/ShortUrl/ShortUrl.php
@@ -15,12 +15,14 @@
1616 die( 1 );
1717 }
1818
19 -// Configuration variables
20 -// Prefix to use for the shortened URL. mod_rewrite (or equivalent) needs to be setup
21 -// to produce a shorter URL
22 -// Default is 'null' which just uses the (not so short) URL that all Special Pages get
23 -// Eg: http://en.wikipedia.org/wiki/Special:ShortUrl/5234
24 -$wgShortUrlPrefix = null;
 19+/**
 20+ * Configuration variables
 21+ * Prefix to use for the shortened URL. mod_rewrite (or equivalent) needs to be setup
 22+ * to produce a shorter URL
 23+ * Default is 'null' which just uses the (not so short) URL that all Special Pages get
 24+ * Eg: http://en.wikipedia.org/wiki/Special:ShortUrl/5234
 25+ */
 26+$wgShortUrlPrefix = null;
2527
2628 // Extension credits that will show up on Special:Version
2729 $wgExtensionCredits['specialpage'][] = array(
@@ -52,4 +54,3 @@
5355 'localBasePath' => dirname( __FILE__ ),
5456 'remoteExtPath' => 'ShortUrl'
5557 );
56 -
Index: trunk/extensions/ShortUrl/ShortUrl.hooks.php
@@ -47,12 +47,13 @@
4848 /**
4949 * @param $out OutputPage
5050 * @param $text string the HTML text to be added
 51+ * @return bool
5152 */
5253 public static function onOutputPageBeforeHTML( &$out, &$text ) {
5354 global $wgOut;
5455 $title = $wgOut->getTitle();
5556 if ( ShortUrlUtils::needsShortUrl( $title ) ) {
56 - $wgOut->addModules( 'ext.shortUrl' );
 57+ $wgOut->addModules( 'ext.shortUrl' );
5758 }
5859 return true;
5960 }

Status & tagging log