r82655 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82654‎ | r82655 | r82656 >
Date:11:15, 23 February 2011
Author:reedy
Status:deferred
Tags:
Comment:
Fixup, comment, rename variable
Modified paths:
  • /trunk/extensions/QrCode/QrCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/QrCode/QrCode.php
@@ -62,14 +62,22 @@
6363 $parser = array_shift($params); // we'll need the parser later
6464
6565 // Handling "Undefined variable" notices
66 - $margin = $ecc = $size = $boundary = $label = false;
 66+ $margin = $ecc = $size = $label = false;
6767
6868 foreach( $params as $pair ) {
6969 $rpms = explode( '=', $pair );
70 - if( $rpms[0] == 'ecc' ) $ecc = $rpms[1];
71 - if( $rpms[0] == 'size' ) $size = $rpms[1];
72 - if( $rpms[0] == 'boundary' ) $margin = $rpms[1];
73 - if( $rpms[0] == 'label' ) $label = $rpms[1];
 70+ if( $rpms[0] == 'ecc' ) {
 71+ $ecc = $rpms[1];
 72+ }
 73+ if( $rpms[0] == 'size' ) {
 74+ $size = $rpms[1];
 75+ }
 76+ if( $rpms[0] == 'boundary' ) {
 77+ $margin = $rpms[1];
 78+ }
 79+ if( $rpms[0] == 'label' ) {
 80+ $label = $rpms[1];
 81+ }
7482 }
7583
7684 $newQrCode = new MWQrCode( $parser, $ecc, $size, $margin );
@@ -82,7 +90,14 @@
8391 */
8492 class MWQrCode {
8593
 94+ /**
 95+ * @var Parser
 96+ */
8697 private $_parser; // simply a link to the parser object
 98+
 99+ /**
 100+ * @var Title
 101+ */
87102 private $_title; // the current page's title object
88103 private $_label; // contents of the qrcode
89104 private $_dstFileName; // what the file will be named?
@@ -186,7 +201,7 @@
187202 $mUpload->initialize( $this->_dstFileName, $this->_tmpName, null ); // we don't know the filesize, how could we?
188203
189204 $pageText = 'QrCode '.$this->_dstFileName.', generated on '.date( "r" )
190 - .' by the QrCode Extension for page [['.$this->_title->getFullText().']].';
 205+ .' by the QrCode Extension for page [['.$this->title->getFullText().']].';
191206
192207 wfDebug( 'UploadQrCodeJob::run: Uploading qrcode, c: '.$this->_uploadComment . ' t: ' . $pageText."\n" );
193208 $status = $mUpload->performUpload( $this->_uploadComment, $pageText, false, $this->_getBot() );

Status & tagging log