r109554 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109553‎ | r109554 | r109555 >
Date:17:27, 19 January 2012
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Documentation

Remove unused globals
Modified paths:
  • /trunk/extensions/PictureGame/AjaxUploadForm.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/HTMLForm.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -3352,7 +3352,7 @@
33533353 * Get an object referring to a locally registered file.
33543354 * Returns a valid placeholder object if the file does not exist.
33553355 *
3356 - * @param $title Title or String
 3356+ * @param $title Title|String
33573357 * @return File|null A File, or null if passed an invalid Title
33583358 */
33593359 function wfLocalFile( $title ) {
Index: trunk/phase3/includes/HTMLForm.php
@@ -338,7 +338,7 @@
339339 /**
340340 * Add header text, inside the form.
341341 * @param $msg String complete text of message to display
342 - * @param $section The section to add the header to
 342+ * @param $section string The section to add the header to
343343 */
344344 function addHeaderText( $msg, $section = null ) {
345345 if ( is_null( $section ) ) {
Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -244,8 +244,7 @@
245245 if(
246246 !$this->mTokenOk && !$this->mCancelUpload &&
247247 ( $this->mUpload && $this->mUploadClicked )
248 - )
249 - {
 248+ ) {
250249 $form->addPreText( wfMsgExt( 'session_fail_preview', 'parseinline' ) );
251250 }
252251
@@ -279,7 +278,6 @@
280279 }
281280
282281 return $form;
283 -
284282 }
285283
286284 /**
@@ -385,7 +383,7 @@
386384 /**
387385 * Show the upload form with error message, but do not stash the file.
388386 *
389 - * @param $message HTML string
 387+ * @param $message string HTML string
390388 */
391389 protected function showUploadError( $message ) {
392390 $message = '<h2>' . wfMsgHtml( 'uploadwarning' ) . "</h2>\n" .
@@ -462,11 +460,17 @@
463461
464462 /**
465463 * Get the initial image page text based on a comment and optional file status information
 464+ * @param $comment string
 465+ * @param $license string
 466+ * @param $copyStatus string
 467+ * @param $source string
 468+ * @return string
466469 */
467470 public static function getInitialPageText( $comment = '', $license = '', $copyStatus = '', $source = '' ) {
468471 global $wgUseCopyrightUpload, $wgForceUIMsgAsContentMsg;
469472 $wgForceUIMsgAsContentMsg = (array) $wgForceUIMsgAsContentMsg;
470473
 474+ $msg = array();
471475 /* These messages are transcluded into the actual text of the description page.
472476 * Thus, forcing them as content messages makes the upload to produce an int: template
473477 * instead of hardcoding it there in the uploader language.
@@ -510,6 +514,7 @@
511515 *
512516 * Note that the page target can be changed *on the form*, so our check
513517 * state can get out of sync.
 518+ * @return Bool|String
514519 */
515520 protected function getWatchCheck() {
516521 if( $this->getUser()->getOption( 'watchdefault' ) ) {
@@ -708,6 +713,8 @@
709714
710715 /**
711716 * Construct a warning and a gallery from an array of duplicate files.
 717+ * @param $dupes array
 718+ * @return string
712719 */
713720 public static function getDupeWarning( $dupes ) {
714721 global $wgOut;
@@ -749,6 +756,8 @@
750757
751758 protected $mMaxFileSize = array();
752759
 760+ protected $mMaxUploadSize = array();
 761+
753762 public function __construct( array $options = array(), IContextSource $context = null ) {
754763 $this->mWatch = !empty( $options['watch'] );
755764 $this->mForReUpload = !empty( $options['forreupload'] );
@@ -1109,6 +1118,11 @@
11101119 * A form field that contains a radio box in the label
11111120 */
11121121 class UploadSourceField extends HTMLTextField {
 1122+
 1123+ /**
 1124+ * @param $cellAttributes array
 1125+ * @return string
 1126+ */
11131127 function getLabelHtml( $cellAttributes = array() ) {
11141128 $id = "wpSourceType{$this->mParams['upload-type']}";
11151129 $label = Html::rawElement( 'label', array( 'for' => $id ), $this->mLabel );
@@ -1129,6 +1143,9 @@
11301144 return Html::rawElement( 'td', array( 'class' => 'mw-label' ) + $cellAttributes, $label );
11311145 }
11321146
 1147+ /**
 1148+ * @return int
 1149+ */
11331150 function getSize() {
11341151 return isset( $this->mParams['size'] )
11351152 ? $this->mParams['size']
Index: trunk/extensions/PictureGame/AjaxUploadForm.php
@@ -92,7 +92,7 @@
9393 * and some bits of code were entirely removed.
9494 */
9595 public function execute( $par ) {
96 - global $wgUser, $wgOut, $wgRequest;
 96+ global $wgUser, $wgOut;
9797
9898 // Disable the skin etc.
9999 $wgOut->setArticleBodyOnly( true );
@@ -359,7 +359,7 @@
360360
361361 # Build a list of IDs for JavaScript insertion
362362 $this->mSourceIds = array();
363 - foreach ( $sourceDescriptor as $key => $field ) {
 363+ foreach ( $sourceDescriptor as $field ) {
364364 if ( !empty( $field['id'] ) ) {
365365 $this->mSourceIds[] = $field['id'];
366366 }
@@ -578,6 +578,9 @@
579579 return $handler;
580580 }
581581
 582+ /**
 583+ * @param $request WebRequest
 584+ */
582585 function initializeFromRequest( &$request ) {
583586 $desiredDestName = $request->getText( 'wpDestFile' );
584587 if( !$desiredDestName ) {
@@ -585,10 +588,10 @@
586589 }
587590 $prefix = $request->getText( 'callbackPrefix' ); // added for PictureGame
588591 $desiredDestName = time() . '-' . $prefix . $desiredDestName;
589 - return $this->initializePathInfo(
 592+ $this->initializePathInfo(
590593 $desiredDestName,
591594 $request->getFileTempName( 'wpUploadFile' ),
592595 $request->getFileSize( 'wpUploadFile' )
593596 );
594597 }
595 -}
\ No newline at end of file
 598+}

Sign-offs

UserFlagDate
Nikerabbitinspected07:11, 20 January 2012

Comments

#Comment by Hashar (talk | contribs)   19:14, 19 January 2012

protected $mMaxUploadSize = array();

Status & tagging log