https://www.mediawiki.org/wiki/Special:Code/MediaWiki/103323
Revision: 103323
Author: reedy
Date: 2011-11-16 13:22:03 +0000 (Wed, 16 Nov 2011)
Log Message:
-----------
Comments, braces, explicit member variables
Remove a couple of unused variables
Modified Paths:
--------------
trunk/extensions/ParserFunctions/ParserFunctions.php
trunk/phase3/includes/LogEventsList.php
trunk/phase3/includes/StubObject.php
trunk/phase3/includes/parser/Tidy.php
trunk/phase3/includes/specials/SpecialBlock.php
trunk/phase3/maintenance/pruneFileCache.php
trunk/phase3/maintenance/updateCollation.php
trunk/phase3/tests/parser/parserTest.inc
Modified: trunk/extensions/ParserFunctions/ParserFunctions.php
===================================================================
--- trunk/extensions/ParserFunctions/ParserFunctions.php 2011-11-16
13:19:17 UTC (rev 103322)
+++ trunk/extensions/ParserFunctions/ParserFunctions.php 2011-11-16
13:22:03 UTC (rev 103323)
@@ -69,6 +69,10 @@
$wgHooks['ParserFirstCallInit'][] = 'wfRegisterParserFunctions';
+/**
+ * @param $parser Parser
+ * @return bool
+ */
function wfRegisterParserFunctions( $parser ) {
global $wgPFEnableStringFunctions, $wgPFEnableConvert;
Modified: trunk/phase3/includes/LogEventsList.php
===================================================================
--- trunk/phase3/includes/LogEventsList.php 2011-11-16 13:19:17 UTC (rev
103322)
+++ trunk/phase3/includes/LogEventsList.php 2011-11-16 13:22:03 UTC (rev
103323)
@@ -677,9 +677,10 @@
$logBody .
$loglist->endLogEventsList();
} else {
- if ( $showIfEmpty )
+ if ( $showIfEmpty ) {
$s = Html::rawElement( 'div', array( 'class' =>
'mw-warning-logempty' ),
wfMsgExt( 'logempty', array(
'parseinline' ) ) );
+ }
}
if( $pager->getNumRows() > $pager->mLimit ) { # Show "Full log"
link
$urlParam = array();
@@ -706,7 +707,7 @@
$s .= '</div>';
}
- if ( $wrap!='' ) { // Wrap message in html
+ if ( $wrap != '' ) { // Wrap message in html
$s = str_replace( '$1', $s, $wrap );
}
@@ -992,7 +993,11 @@
return $info;
}
- // Checks if $this->mConds has $field matched to a *single* value
+ /**
+ * Checks if $this->mConds has $field matched to a *single* value
+ * @param $field
+ * @return bool
+ */
protected function hasEqualsClause( $field ) {
return (
array_key_exists( $field, $this->mConds ) &&
Modified: trunk/phase3/includes/StubObject.php
===================================================================
--- trunk/phase3/includes/StubObject.php 2011-11-16 13:19:17 UTC (rev
103322)
+++ trunk/phase3/includes/StubObject.php 2011-11-16 13:22:03 UTC (rev
103323)
@@ -90,8 +90,9 @@
function _unstub( $name = '_unstub', $level = 2 ) {
static $recursionLevel = 0;
- if ( !($GLOBALS[$this->mGlobal] instanceof StubObject) )
+ if ( !($GLOBALS[$this->mGlobal] instanceof StubObject) ) {
return $GLOBALS[$this->mGlobal]; // already unstubbed.
+ }
if ( get_class( $GLOBALS[$this->mGlobal] ) != $this->mClass ) {
$fname = __METHOD__.'-'.$this->mGlobal;
@@ -124,6 +125,9 @@
return $this->_call( $name, $args );
}
+ /**
+ * @return Language
+ */
function _newObject() {
global $wgLanguageCode;
$obj = Language::factory( $wgLanguageCode );
@@ -148,6 +152,9 @@
return $this->_call( $name, $args );
}
+ /**
+ * @return Language
+ */
function _newObject() {
return RequestContext::getMain()->getLang();
}
Modified: trunk/phase3/includes/parser/Tidy.php
===================================================================
--- trunk/phase3/includes/parser/Tidy.php 2011-11-16 13:19:17 UTC (rev
103322)
+++ trunk/phase3/includes/parser/Tidy.php 2011-11-16 13:22:03 UTC (rev
103323)
@@ -11,7 +11,7 @@
* we may create a real postprocessor or something that will replace this.
* It's called wrapper because for now it basically takes over MWTidy::tidy's
task
* of wrapping the text in a xhtml block
- *
+ *
* This re-uses some of the parser's UNIQ tricks, though some of it is private
so it's
* duplicated. Perhaps we should create an abstract marker hiding class.
*/
@@ -40,7 +40,7 @@
$this->mUniqPrefix = "\x7fUNIQ" .
dechex( mt_rand( 0, 0x7fffffff ) ) . dechex( mt_rand(
0, 0x7fffffff ) );
$this->mMarkerIndex = 0;
-
+
$wrappedtext = preg_replace_callback(
ParserOutput::EDITSECTION_REGEX,
array( &$this, 'replaceEditSectionLinksCallback' ),
$text );
@@ -126,7 +126,7 @@
*/
public static function checkErrors( $text, &$errorStr = null ) {
global $wgTidyInternal;
-
+
$retval = 0;
if( $wgTidyInternal ) {
$errorStr = self::execInternalTidy( $text, true,
$retval );
@@ -166,7 +166,7 @@
2 => array( 'file', wfGetNull(), 'a' )
);
}
-
+
$readpipe = $stderr ? 2 : 1;
$pipes = array();
@@ -217,7 +217,7 @@
if ( !MWInit::classExists( 'tidy' ) ) {
wfWarn( "Unable to load internal tidy class." );
$retval = -1;
-
+
wfProfileOut( __METHOD__ );
return null;
}
@@ -245,7 +245,7 @@
"\n-->";
}
}
-
+
wfProfileOut( __METHOD__ );
return $cleansource;
}
Modified: trunk/phase3/includes/specials/SpecialBlock.php
===================================================================
--- trunk/phase3/includes/specials/SpecialBlock.php 2011-11-16 13:19:17 UTC
(rev 103322)
+++ trunk/phase3/includes/specials/SpecialBlock.php 2011-11-16 13:22:03 UTC
(rev 103323)
@@ -297,7 +297,6 @@
/**
* Add header elements like block log entries, etc.
- * @return void
*/
protected function preText(){
$text = $this->msg( 'blockiptext' )->parse();
Modified: trunk/phase3/maintenance/pruneFileCache.php
===================================================================
--- trunk/phase3/maintenance/pruneFileCache.php 2011-11-16 13:19:17 UTC (rev
103322)
+++ trunk/phase3/maintenance/pruneFileCache.php 2011-11-16 13:22:03 UTC (rev
103323)
@@ -23,6 +23,9 @@
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
class PruneFileCache extends Maintenance {
+
+ protected $minSurviveTimestamp;
+
public function __construct() {
parent::__construct();
$this->mDescription = "Build file cache for content pages";
Modified: trunk/phase3/maintenance/updateCollation.php
===================================================================
--- trunk/phase3/maintenance/updateCollation.php 2011-11-16 13:19:17 UTC
(rev 103322)
+++ trunk/phase3/maintenance/updateCollation.php 2011-11-16 13:22:03 UTC
(rev 103323)
@@ -43,7 +43,7 @@
up-to-date, it will do nothing.
TEXT;
- $this->addOption( 'force', 'Run on all rows, even if the
collation is ' .
+ $this->addOption( 'force', 'Run on all rows, even if the
collation is ' .
'supposed to be up-to-date.' );
$this->addOption( 'previous-collation', 'Set the previous value
of ' .
'$wgCategoryCollation here to speed up this script,
especially if your ' .
@@ -111,7 +111,7 @@
# This is an old-style row, so the
sortkey needs to be
# converted.
if ( $row->cl_sortkey ==
$title->getText()
- || $row->cl_sortkey ==
$title->getPrefixedText() ) {
+ || $row->cl_sortkey ==
$title->getPrefixedText() ) {
$prefix = '';
} else {
# Custom sortkey, use it as a
prefix
@@ -148,14 +148,14 @@
if ( $force && $row ) {
$encFrom = $dbw->addQuotes( $row->cl_from );
$encTo = $dbw->addQuotes( $row->cl_to );
- $batchConds = array(
+ $batchConds = array(
"(cl_from = $encFrom AND cl_to >
$encTo) " .
" OR cl_from > $encFrom" );
}
$count += $res->numRows();
$this->output( "$count done.\n" );
-
+
if ( ++$batchCount % self::SYNC_INTERVAL == 0 ) {
$this->output( "Waiting for slaves ... " );
wfWaitForSlaves();
Modified: trunk/phase3/tests/parser/parserTest.inc
===================================================================
--- trunk/phase3/tests/parser/parserTest.inc 2011-11-16 13:19:17 UTC (rev
103322)
+++ trunk/phase3/tests/parser/parserTest.inc 2011-11-16 13:22:03 UTC (rev
103323)
@@ -766,7 +766,6 @@
}
$temporary = $this->useTemporaryTables || $dbType == 'postgres';
- $tables = $this->listTables();
$prefix = $dbType != 'oracle' ? 'parsertest_' : 'pt_';
$this->dbClone = new CloneDatabase( $this->db,
$this->listTables(), $prefix );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs