r97491 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97490‎ | r97491 | r97492 >
Date:13:47, 19 September 2011
Author:reedy
Status:ok
Tags:
Comment:
Fix assingment in conditionals

Remove unused globals/variables
Modified paths:
  • /trunk/extensions/CategoryBrowser/CategoryBrowser.php (modified) (history)
  • /trunk/extensions/ExtensionManagement/specials/SpecialExtensionManagement.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -514,7 +514,6 @@
515515 return $this->mNamespaceIds;
516516 }
517517
518 -
519518 /**
520519 * Get a namespace key by value, case insensitive. Canonical namespace
521520 * names override custom ones defined for the current language.
@@ -524,7 +523,8 @@
525524 */
526525 function getNsIndex( $text ) {
527526 $lctext = $this->lc( $text );
528 - if ( ( $ns = MWNamespace::getCanonicalIndex( $lctext ) ) !== null ) {
 527+ $ns = MWNamespace::getCanonicalIndex( $lctext );
 528+ if ( $ns !== null ) {
529529 return $ns;
530530 }
531531 $ids = $this->getNamespaceIds();
@@ -543,7 +543,9 @@
544544 list( $rootCode ) = explode( '-', $code );
545545 if( $usemsg && wfMessage( $msg )->exists() ) {
546546 return $this->getMessageFromDB( $msg );
547 - } elseif( $name = self::getLanguageName( $code ) ) {
 547+ }
 548+ $name = self::getLanguageName( $code );
 549+ if( $name ) {
548550 return $name; # if it's defined as a language name, show that
549551 } else {
550552 # otherwise, output the language code
Index: trunk/extensions/CategoryBrowser/CategoryBrowser.php
@@ -56,7 +56,7 @@
5757 $wgExtensionAliasesFiles['CategoryBrowser'] = $dir . '/CategoryBrowser.alias.php';
5858 $wgSpecialPages['CategoryBrowser'] = 'CategoryBrowserPage';
5959 $wgSpecialPageGroups['CategoryBrowser'] = 'pages';
60 -
 60+
6161 CB_Setup::init();
6262
6363 class CB_Setup {
@@ -95,11 +95,7 @@
9696 */
9797 static function init() {
9898 global $wgScriptPath;
99 - global $wgExtensionMessagesFiles;
10099 global $wgAutoloadClasses;
101 - global $wgExtensionCredits;
102 - global $wgSpecialPages;
103 - global $wgSpecialPageGroups;
104100 global $wgAjaxExportList;
105101
106102 self::$ExtDir = str_replace( "\\", "/", dirname( __FILE__ ) );
Index: trunk/extensions/ExtensionManagement/specials/SpecialExtensionManagement.php
@@ -15,7 +15,7 @@
1616 static $viewvcUrls = array(
1717 'svn+ssh://svn.wikimedia.org/svnroot/mediawiki' => 'http://svn.wikimedia.org/viewvc/mediawiki',
1818 'http://svn.wikimedia.org/svnroot/mediawiki' => 'http://svn.wikimedia.org/viewvc/mediawiki',
19 - # Doesn't work at the time of writing but maybe some day:
 19+ # Doesn't work at the time of writing but maybe some day:
2020 'https://svn.wikimedia.org/viewvc/mediawiki' => 'http://svn.wikimedia.org/viewvc/mediawiki',
2121 );
2222
@@ -43,10 +43,8 @@
4444
4545
4646 function displayExtensions() {
47 - global $wgOut, $wgExtensionCredits;
 47+ global $wgExtensionCredits;
4848
49 - $extensionAmount = 0;
50 -
5149 $extensionTypes = array(
5250 'specialpage' => wfMsg( 'version-specialpages' ),
5351 'parserhook' => wfMsg( 'version-parserhooks' ),
@@ -125,8 +123,8 @@
126124 }
127125 # Version
128126 if ( isset( $extension['version'] ) ) {
129 - $versionText = '<span class="mw-version-ext-version"><em>' .
130 - wfMsg( 'version-version', $extension['version'] ) .
 127+ $versionText = '<span class="mw-version-ext-version"><em>' .
 128+ wfMsg( 'version-version', $extension['version'] ) .
131129 '</em></span> | ';
132130 } else {
133131 $versionText = '';
@@ -203,7 +201,7 @@
204202 } else {
205203 if( is_object( $list[0] ) )
206204 $class = get_class( $list[0] );
207 - else
 205+ else
208206 $class = $list[0];
209207 return "($class, {$list[1]})";
210208 }

Status & tagging log