Tidy up some unused variables and such
authorSam Reed <reedy@users.mediawiki.org>
Sat, 23 Apr 2011 21:40:52 +0000 (21:40 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 23 Apr 2011 21:40:52 +0000 (21:40 +0000)
14 files changed:
includes/FileDeleteForm.php
includes/Import.php
includes/UserMailer.php
includes/ZipDirectoryReader.php
includes/db/DatabaseOracle.php
includes/installer/MysqlInstaller.php
includes/parser/LinkHolderArray.php
includes/specials/SpecialUploadStash.php
languages/classes/LanguageTyv.php
maintenance/importUseModWikipedia.php
maintenance/populateCategory.php
tests/phpunit/includes/FormOptionsInitializationTest.php
tests/phpunit/includes/TitlePermissionTest.php
tests/phpunit/phpunit.php

index 9101d6e..2c87ccc 100644 (file)
@@ -118,7 +118,6 @@ class FileDeleteForm {
                } else {
                        $id = $title->getArticleID( Title::GAID_FOR_UPDATE );
                        $article = new Article( $title );
-                       $error = '';
                        $dbw = wfGetDB( DB_MASTER );
                        try {
                                // delete the associated article first
index bdf70aa..1c3bbd9 100644 (file)
@@ -907,6 +907,9 @@ class WikiRevision {
                $this->params = $params;
        }
 
+       /**
+        * @return Title
+        */
        function getTitle() {
                return $this->title;
        }
index 14c7d1e..31ff18b 100644 (file)
@@ -127,7 +127,6 @@ class UserMailer {
                }
 
                if ( is_array( $wgSMTP ) ) {
-                       $found = false;
                        if ( function_exists( 'stream_resolve_include_path' ) ) {
                                $found = stream_resolve_include_path( 'Mail.php' );
                        } else {
index 7f5b0b6..eb75b68 100644 (file)
@@ -542,7 +542,7 @@ class ZipDirectoryReader {
         */
        function getStructSize( $struct ) {
                $size = 0;
-               foreach ( $struct as $key => $type ) {
+               foreach ( $struct as $type ) {
                        if ( is_array( $type ) ) {
                                list( $typeName, $fieldSize ) = $type;
                                $size += $fieldSize;
index 794710b..3e84bad 100644 (file)
@@ -1097,7 +1097,7 @@ class DatabaseOracle extends DatabaseBase {
        }
 
        public function removeIdentifierQuotes( $s ) {
-               return strpos($s, '/*Q*/') === FALSE ? $s : substr($s, 5); ;
+               return strpos($s, '/*Q*/') === FALSE ? $s : substr($s, 5);
        }
 
        public function isQuotedIdentifier( $s ) {
index 84f20fc..7ef8ddf 100644 (file)
@@ -494,7 +494,6 @@ class MysqlInstaller extends DatabaseInstaller {
                }
 
                // Try to grant to all the users we know exist or we were able to create
-               $escPass = $this->db->addQuotes( $password );
                $dbAllTables = $this->db->addIdentifierQuotes( $dbName ) . '.*';
                foreach( $grantableNames as $name ) {
                        try {
index 8037732..b724990 100644 (file)
@@ -35,15 +35,15 @@ class LinkHolderArray {
         * Compact the titles, only serialize the text form.
         */
        function __sleep() {
-               foreach ( $this->internals as $ns => &$nsLinks ) {
-                       foreach ( $nsLinks as $key => &$entry ) {
+               foreach ( $this->internals as &$nsLinks ) {
+                       foreach ( $nsLinks as &$entry ) {
                                unset( $entry['title'] );
                        }
                }
                unset( $nsLinks );
                unset( $entry );
 
-               foreach ( $this->interwikis as $key => &$entry ) {
+               foreach ( $this->interwikis as &$entry ) {
                        unset( $entry['title'] );
                }
                unset( $entry );
@@ -55,8 +55,8 @@ class LinkHolderArray {
         * Recreate the Title objects
         */
        function __wakeup() {
-               foreach ( $this->internals as $ns => &$nsLinks ) {
-                       foreach ( $nsLinks as $key => &$entry ) {
+               foreach ( $this->internals as &$nsLinks ) {
+                       foreach ( $nsLinks as &$entry ) {
                                $entry['title'] = Title::newFromText( $entry['pdbk'] );
                        }
                }
@@ -259,7 +259,6 @@ class LinkHolderArray {
 
                wfProfileIn( __METHOD__.'-check' );
                $dbr = wfGetDB( DB_SLAVE );
-               $page = $dbr->tableName( 'page' );
                $threshold = $this->parent->getOptions()->getStubThreshold();
 
                # Sort by namespace
@@ -268,8 +267,6 @@ class LinkHolderArray {
                $linkcolour_ids = array();
 
                # Generate query
-               $query = false;
-               $current = null;
                $queries = array();
                foreach ( $this->internals as $ns => $entries ) {
                        foreach ( $entries as $entry ) {
index 901ecea..f262c0a 100644 (file)
@@ -320,7 +320,6 @@ class SpecialUploadStash extends UnlistedSpecialPage {
                $this->setHeaders();
                $this->outputHeader();
 
-
                // create the form, which will also be used to execute a callback to process incoming form data
                // this design is extremely dubious, but supposedly HTMLForm is our standard now?
 
index 9e5b645..8bca11b 100644 (file)
@@ -28,7 +28,7 @@ class LanguageTyv extends Language {
                $roundFrontVowels = array( "ө", "ү", "ö", "ü" );
                $unroundBackVowels = array( "а", "ы", "я", "a", "y" );
                $roundBackVowels = array( "ё", "о", "у", "ю", "o", "u" );
-               $voicedPhonemes = array( "д", "б", "з", "ж", "г", "d", "b", "z", "g" );
+               //$voicedPhonemes = array( "д", "б", "з", "ж", "г", "d", "b", "z", "g" );
                $unvoicedPhonemes = array( "т", "п", "с", "ш", "к", "ч", "х", "t", "p", "s", "k", "x" );
                $directiveUnvoicedStems = array( "т", "п", "с", "ш", "к", "ч", "х", "л", "м", "н", "ң", "t", "p", "s", "k", "x", "l", "m", "n", "ŋ" );
                $directiveVoicedStems = array( "д", "б", "з", "ж", "г", "р", "й", "d", "b", "z", "g", "r", "j" );
index 6092f34..c4b8112 100644 (file)
@@ -480,7 +480,6 @@ EOT
 
        function resolveFailedDiff( $origText, $diff ) {
                $context = array();
-               $rxRange = '\d+(?:,(\d+))?';
                $diffLines = explode( "\n", $diff );
                for ( $i = 0; $i < count( $diffLines ); $i++ ) {
                        $diffLine = $diffLines[$i];
@@ -525,10 +524,10 @@ EOT
                $removedLinks = array_diff( $sourceLinks, $destLinks );
 
                // Match up the removed links with the new links
-               foreach ( $newLinks as $j => $newLink ) {
+               foreach ( $newLinks as $newLink ) {
                        $minDistance = 100000000;
                        $bestRemovedLink = false;
-                       foreach ( $removedLinks as $k => $removedLink ) {
+                       foreach ( $removedLinks as $removedLink ) {
                                $editDistance = levenshtein( $newLink, $removedLink );
                                if ( $editDistance < $minDistance ) {
                                        $minDistance = $editDistance;
index 13b77fa..4e9c44c 100644 (file)
@@ -81,7 +81,6 @@ TEXT;
                        }
                }
 
-               $maxlag = intval( $maxlag );
                $throttle = intval( $throttle );
                if ( $begin !== '' ) {
                        $where = 'cl_to > ' . $dbw->addQuotes( $begin );
index b2f7fdb..1997cc5 100644 (file)
@@ -14,7 +14,9 @@
  * array is correctly set through the FormOptions::add() function.
  */
 class FormOptionsExposed extends FormOptions {
-       public $options;
+       public function getOptions() {
+               return $this->options;
+       }
 }
 
 /**
@@ -54,7 +56,7 @@ class FormOptionsInitializationTest extends MediaWikiTestCase {
                                        'value' => null,
                                        )
                        ),
-                       $this->object->options
+                       $this->object->getOptions()
                );
        }
 
@@ -76,7 +78,7 @@ class FormOptionsInitializationTest extends MediaWikiTestCase {
                                        'type'   => FormOptions::INT,
                                        )
                        ),
-                       $this->object->options
+                       $this->object->getOptions
                );
        }
 
index cb1f720..2ad6242 100644 (file)
@@ -331,7 +331,6 @@ class TitlePermissionTest extends MediaWikiTestCase {
                $this->setUser( $this->userName );
                global $wgUser, $wgContLang;
                $wgUser = $this->user;
-               $prefix = $wgContLang->getFormattedNsText( NS_PROJECT );
 
                $this->setTitle( NS_SPECIAL );
 
index 5c4db3a..e9381eb 100755 (executable)
@@ -19,7 +19,7 @@ require_once( "$IP/maintenance/Maintenance.php" );
 
 class PHPUnitMaintClass extends Maintenance {
        public function finalSetup() {
-               $settings = parent::finalSetup();
+               parent::finalSetup();
 
                global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgUseDatabaseMessages;