From: Sam Reed Date: Sat, 23 Apr 2011 21:40:52 +0000 (+0000) Subject: Tidy up some unused variables and such X-Git-Tag: 1.31.0-rc.0~30585 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=8e80b8c3c13e757e0d6b773db027de81000391f5;p=lhc%2Fweb%2Fwiklou.git Tidy up some unused variables and such --- diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php index 9101d6e4f0..2c87ccc99b 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -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 diff --git a/includes/Import.php b/includes/Import.php index bdf70aab69..1c3bbd9a61 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -907,6 +907,9 @@ class WikiRevision { $this->params = $params; } + /** + * @return Title + */ function getTitle() { return $this->title; } diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 14c7d1e37c..31ff18bf24 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -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 { diff --git a/includes/ZipDirectoryReader.php b/includes/ZipDirectoryReader.php index 7f5b0b6b33..eb75b68736 100644 --- a/includes/ZipDirectoryReader.php +++ b/includes/ZipDirectoryReader.php @@ -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; diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 794710b046..3e84badabb 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -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 ) { diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 84f20fc1a4..7ef8ddf3bf 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -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 { diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index 80377325c0..b7249901c5 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -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 ) { diff --git a/includes/specials/SpecialUploadStash.php b/includes/specials/SpecialUploadStash.php index 901eceaf65..f262c0a80f 100644 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@ -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? diff --git a/languages/classes/LanguageTyv.php b/languages/classes/LanguageTyv.php index 9e5b6453af..8bca11b23b 100644 --- a/languages/classes/LanguageTyv.php +++ b/languages/classes/LanguageTyv.php @@ -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" ); diff --git a/maintenance/importUseModWikipedia.php b/maintenance/importUseModWikipedia.php index 6092f34d75..c4b8112f26 100644 --- a/maintenance/importUseModWikipedia.php +++ b/maintenance/importUseModWikipedia.php @@ -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; diff --git a/maintenance/populateCategory.php b/maintenance/populateCategory.php index 13b77fa862..4e9c44c416 100644 --- a/maintenance/populateCategory.php +++ b/maintenance/populateCategory.php @@ -81,7 +81,6 @@ TEXT; } } - $maxlag = intval( $maxlag ); $throttle = intval( $throttle ); if ( $begin !== '' ) { $where = 'cl_to > ' . $dbw->addQuotes( $begin ); diff --git a/tests/phpunit/includes/FormOptionsInitializationTest.php b/tests/phpunit/includes/FormOptionsInitializationTest.php index b2f7fdb4d4..1997cc5e8a 100644 --- a/tests/phpunit/includes/FormOptionsInitializationTest.php +++ b/tests/phpunit/includes/FormOptionsInitializationTest.php @@ -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 ); } diff --git a/tests/phpunit/includes/TitlePermissionTest.php b/tests/phpunit/includes/TitlePermissionTest.php index cb1f720c7c..2ad6242f84 100644 --- a/tests/phpunit/includes/TitlePermissionTest.php +++ b/tests/phpunit/includes/TitlePermissionTest.php @@ -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 ); diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index 5c4db3a0ad..e9381eb782 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -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;