From: Reedy Date: Sun, 9 Dec 2012 03:27:02 +0000 (+0000) Subject: Kill off numerous unused variables X-Git-Tag: 1.31.0-rc.0~20404^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=c3e4057e06ac785da8ed03ede2ba7b2d07858921;p=lhc%2Fweb%2Fwiklou.git Kill off numerous unused variables Change-Id: I7039f1328f37ee669b694f73ee282602186bffd1 --- diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 06e7ee46cd..98e54f999a 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -1326,7 +1326,7 @@ abstract class HTMLFormField { * @return String complete HTML table row. */ public function getRaw( $value ) { - list( $errors, $errorClass ) = $this->getErrorsAndErrorClass( $value ); + list( $errors, ) = $this->getErrorsAndErrorClass( $value ); $inputHtml = $this->getInputHTML( $value ); $helptext = $this->getHelpTextHtmlRaw( $this->getHelpText() ); $cellAttributes = array(); diff --git a/includes/Title.php b/includes/Title.php index 46b0524c9e..5d71251b82 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -4464,7 +4464,7 @@ class Title { // Use always content language to avoid loading hundreds of languages // to get the link color. global $wgContLang; - list( $name, $lang ) = MessageCache::singleton()->figureMessage( $wgContLang->lcfirst( $this->getText() ) ); + list( $name, ) = MessageCache::singleton()->figureMessage( $wgContLang->lcfirst( $this->getText() ) ); $message = wfMessage( $name )->inLanguage( $wgContLang )->useDatabase( false ); return $message->exists(); } diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 2195fbbd91..3bb001144b 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -206,7 +206,7 @@ class WebRequest { * @return string */ public static function detectProtocol() { - list( $proto, $stdPort ) = self::detectProtocolAndStdPort(); + list( $proto, ) = self::detectProtocolAndStdPort(); return $proto; } diff --git a/includes/ZipDirectoryReader.php b/includes/ZipDirectoryReader.php index e5423f58c9..931e58ddb1 100644 --- a/includes/ZipDirectoryReader.php +++ b/includes/ZipDirectoryReader.php @@ -570,7 +570,7 @@ class ZipDirectoryReader { $size = 0; foreach ( $struct as $type ) { if ( is_array( $type ) ) { - list( $typeName, $fieldSize ) = $type; + list( , $fieldSize ) = $type; $size += $fieldSize; } else { $size += $type; diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 34f78e7820..1352f06cad 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -367,7 +367,7 @@ class ApiQueryImageInfo extends ApiQueryBase { } if ( isset( $prop['thumbmime'] ) && $file->getHandler() ) { - list( $ext, $mime ) = $file->getHandler()->getThumbType( + list( , $mime ) = $file->getHandler()->getThumbType( $mto->getExtension(), $file->getMimeType(), $thumbParams ); $vals['thumbmime'] = $mime; } diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 596fd0661a..810e1d6b8e 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -376,7 +376,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { ); } } else { - list( $host, $lag, $index ) = $lb->getMaxLag(); + list( , $lag, $index ) = $lb->getMaxLag(); $data[] = array( 'host' => $wgShowHostnames ? $lb->getServerName( $index ) diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index d87c72d0b1..ae549da100 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -1050,8 +1050,6 @@ abstract class ContentHandler { wfSuppressWarnings(); foreach ( $handlers as $handler ) { - $info = ''; - if ( is_array( $handler ) ) { if ( is_object( $handler[0] ) ) { $info = get_class( $handler[0] ); diff --git a/includes/content/TextContent.php b/includes/content/TextContent.php index 23d21ec48d..65007c8f36 100644 --- a/includes/content/TextContent.php +++ b/includes/content/TextContent.php @@ -173,14 +173,16 @@ class TextContent extends AbstractContent { # @todo: could implement this in DifferenceEngine and just delegate here? - if ( !$lang ) $lang = $wgContLang; + if ( !$lang ) { + $lang = $wgContLang; + } $otext = $this->getNativeData(); $ntext = $this->getNativeData(); # Note: Use native PHP diff, external engines don't give us abstract output - $ota = explode( "\n", $wgContLang->segmentForDiff( $otext ) ); - $nta = explode( "\n", $wgContLang->segmentForDiff( $ntext ) ); + $ota = explode( "\n", $lang->segmentForDiff( $otext ) ); + $nta = explode( "\n", $lang->segmentForDiff( $ntext ) ); $diff = new Diff( $ota, $nta ); return $diff; diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index cbd79c348d..22684c8b58 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -684,11 +684,8 @@ class LoadBalancer { 'See DefaultSettings.php entry for $wgDBservers.' ); } - $host = $server['host']; - $dbname = $server['dbname']; - if ( $dbNameOverride !== false ) { - $server['dbname'] = $dbname = $dbNameOverride; + $server['dbname'] = $dbNameOverride; } # Create object diff --git a/includes/filebackend/FSFileBackend.php b/includes/filebackend/FSFileBackend.php index 9cdb8568a0..fb5ac96d28 100644 --- a/includes/filebackend/FSFileBackend.php +++ b/includes/filebackend/FSFileBackend.php @@ -145,7 +145,7 @@ class FSFileBackend extends FileBackendStore { if ( $relPath === null ) { return null; // invalid } - list( $b, $shortCont, $r ) = FileBackend::splitStoragePath( $storagePath ); + list( , $shortCont, ) = FileBackend::splitStoragePath( $storagePath ); $fsPath = $this->containerFSRoot( $shortCont, $fullCont ); // must be valid if ( $relPath != '' ) { $fsPath .= "/{$relPath}"; @@ -460,7 +460,7 @@ class FSFileBackend extends FileBackendStore { */ protected function doPrepareInternal( $fullCont, $dirRel, array $params ) { $status = Status::newGood(); - list( $b, $shortCont, $r ) = FileBackend::splitStoragePath( $params['dir'] ); + list( , $shortCont, ) = FileBackend::splitStoragePath( $params['dir'] ); $contRoot = $this->containerFSRoot( $shortCont, $fullCont ); // must be valid $dir = ( $dirRel != '' ) ? "{$contRoot}/{$dirRel}" : $contRoot; $existed = is_dir( $dir ); // already there? @@ -487,7 +487,7 @@ class FSFileBackend extends FileBackendStore { */ protected function doSecureInternal( $fullCont, $dirRel, array $params ) { $status = Status::newGood(); - list( $b, $shortCont, $r ) = FileBackend::splitStoragePath( $params['dir'] ); + list( , $shortCont, ) = FileBackend::splitStoragePath( $params['dir'] ); $contRoot = $this->containerFSRoot( $shortCont, $fullCont ); // must be valid $dir = ( $dirRel != '' ) ? "{$contRoot}/{$dirRel}" : $contRoot; // Seed new directories with a blank index.html, to prevent crawling... @@ -518,7 +518,7 @@ class FSFileBackend extends FileBackendStore { */ protected function doPublishInternal( $fullCont, $dirRel, array $params ) { $status = Status::newGood(); - list( $b, $shortCont, $r ) = FileBackend::splitStoragePath( $params['dir'] ); + list( , $shortCont, ) = FileBackend::splitStoragePath( $params['dir'] ); $contRoot = $this->containerFSRoot( $shortCont, $fullCont ); // must be valid $dir = ( $dirRel != '' ) ? "{$contRoot}/{$dirRel}" : $contRoot; // Unseed new directories with a blank index.html, to allow crawling... @@ -549,7 +549,7 @@ class FSFileBackend extends FileBackendStore { */ protected function doCleanInternal( $fullCont, $dirRel, array $params ) { $status = Status::newGood(); - list( $b, $shortCont, $r ) = FileBackend::splitStoragePath( $params['dir'] ); + list( , $shortCont, ) = FileBackend::splitStoragePath( $params['dir'] ); $contRoot = $this->containerFSRoot( $shortCont, $fullCont ); // must be valid $dir = ( $dirRel != '' ) ? "{$contRoot}/{$dirRel}" : $contRoot; $this->trapWarnings(); @@ -598,7 +598,7 @@ class FSFileBackend extends FileBackendStore { * @return bool|null */ protected function doDirectoryExists( $fullCont, $dirRel, array $params ) { - list( $b, $shortCont, $r ) = FileBackend::splitStoragePath( $params['dir'] ); + list( , $shortCont, ) = FileBackend::splitStoragePath( $params['dir'] ); $contRoot = $this->containerFSRoot( $shortCont, $fullCont ); // must be valid $dir = ( $dirRel != '' ) ? "{$contRoot}/{$dirRel}" : $contRoot; @@ -614,7 +614,7 @@ class FSFileBackend extends FileBackendStore { * @return Array|null */ public function getDirectoryListInternal( $fullCont, $dirRel, array $params ) { - list( $b, $shortCont, $r ) = FileBackend::splitStoragePath( $params['dir'] ); + list( , $shortCont, ) = FileBackend::splitStoragePath( $params['dir'] ); $contRoot = $this->containerFSRoot( $shortCont, $fullCont ); // must be valid $dir = ( $dirRel != '' ) ? "{$contRoot}/{$dirRel}" : $contRoot; $exists = is_dir( $dir ); @@ -633,7 +633,7 @@ class FSFileBackend extends FileBackendStore { * @return Array|FSFileBackendFileList|null */ public function getFileListInternal( $fullCont, $dirRel, array $params ) { - list( $b, $shortCont, $r ) = FileBackend::splitStoragePath( $params['dir'] ); + list( , $shortCont, ) = FileBackend::splitStoragePath( $params['dir'] ); $contRoot = $this->containerFSRoot( $shortCont, $fullCont ); // must be valid $dir = ( $dirRel != '' ) ? "{$contRoot}/{$dirRel}" : $contRoot; $exists = is_dir( $dir ); diff --git a/includes/filebackend/FileBackend.php b/includes/filebackend/FileBackend.php index 47bc7ac9ad..77e35d4f82 100644 --- a/includes/filebackend/FileBackend.php +++ b/includes/filebackend/FileBackend.php @@ -1279,7 +1279,7 @@ abstract class FileBackend { */ final public static function parentStoragePath( $storagePath ) { $storagePath = dirname( $storagePath ); - list( $b, $cont, $rel ) = self::splitStoragePath( $storagePath ); + list( , , $rel ) = self::splitStoragePath( $storagePath ); return ( $rel === null ) ? null : $storagePath; } diff --git a/includes/filebackend/FileBackendGroup.php b/includes/filebackend/FileBackendGroup.php index 0bf5279af5..d790a99601 100644 --- a/includes/filebackend/FileBackendGroup.php +++ b/includes/filebackend/FileBackendGroup.php @@ -184,7 +184,7 @@ class FileBackendGroup { * @return FileBackend|null Backend or null on failure */ public function backendFromPath( $storagePath ) { - list( $backend, $c, $p ) = FileBackend::splitStoragePath( $storagePath ); + list( $backend, , ) = FileBackend::splitStoragePath( $storagePath ); if ( $backend !== null && isset( $this->backends[$backend] ) ) { return $this->get( $backend ); } diff --git a/includes/filebackend/FileBackendMultiWrite.php b/includes/filebackend/FileBackendMultiWrite.php index e6fe147f37..efa5eac8b7 100644 --- a/includes/filebackend/FileBackendMultiWrite.php +++ b/includes/filebackend/FileBackendMultiWrite.php @@ -451,7 +451,7 @@ class FileBackendMultiWrite extends FileBackend { * @return bool Path container should have dir changes pushed to all backends */ protected function replicateContainerDirChanges( $path ) { - list( $b, $shortCont, $r ) = self::splitStoragePath( $path ); + list( , $shortCont, ) = self::splitStoragePath( $path ); return !in_array( $shortCont, $this->noPushDirConts ); } diff --git a/includes/filebackend/FileBackendStore.php b/includes/filebackend/FileBackendStore.php index 35384c7fee..55bb8ddb60 100644 --- a/includes/filebackend/FileBackendStore.php +++ b/includes/filebackend/FileBackendStore.php @@ -447,7 +447,7 @@ abstract class FileBackendStore extends FileBackend { $status->merge( $this->doPrepareInternal( $fullCont, $dir, $params ) ); } else { // directory is on several shards wfDebug( __METHOD__ . ": iterating over all container shards.\n" ); - list( $b, $shortCont, $r ) = self::splitStoragePath( $params['dir'] ); + list( , $shortCont, ) = self::splitStoragePath( $params['dir'] ); foreach ( $this->getContainerSuffixes( $shortCont ) as $suffix ) { $status->merge( $this->doPrepareInternal( "{$fullCont}{$suffix}", $dir, $params ) ); } @@ -487,7 +487,7 @@ abstract class FileBackendStore extends FileBackend { $status->merge( $this->doSecureInternal( $fullCont, $dir, $params ) ); } else { // directory is on several shards wfDebug( __METHOD__ . ": iterating over all container shards.\n" ); - list( $b, $shortCont, $r ) = self::splitStoragePath( $params['dir'] ); + list( , $shortCont, ) = self::splitStoragePath( $params['dir'] ); foreach ( $this->getContainerSuffixes( $shortCont ) as $suffix ) { $status->merge( $this->doSecureInternal( "{$fullCont}{$suffix}", $dir, $params ) ); } @@ -527,7 +527,7 @@ abstract class FileBackendStore extends FileBackend { $status->merge( $this->doPublishInternal( $fullCont, $dir, $params ) ); } else { // directory is on several shards wfDebug( __METHOD__ . ": iterating over all container shards.\n" ); - list( $b, $shortCont, $r ) = self::splitStoragePath( $params['dir'] ); + list( , $shortCont, ) = self::splitStoragePath( $params['dir'] ); foreach ( $this->getContainerSuffixes( $shortCont ) as $suffix ) { $status->merge( $this->doPublishInternal( "{$fullCont}{$suffix}", $dir, $params ) ); } @@ -589,7 +589,7 @@ abstract class FileBackendStore extends FileBackend { $this->deleteContainerCache( $fullCont ); // purge cache } else { // directory is on several shards wfDebug( __METHOD__ . ": iterating over all container shards.\n" ); - list( $b, $shortCont, $r ) = self::splitStoragePath( $params['dir'] ); + list( , $shortCont, ) = self::splitStoragePath( $params['dir'] ); foreach ( $this->getContainerSuffixes( $shortCont ) as $suffix ) { $status->merge( $this->doCleanInternal( "{$fullCont}{$suffix}", $dir, $params ) ); $this->deleteContainerCache( "{$fullCont}{$suffix}" ); // purge cache @@ -951,7 +951,7 @@ abstract class FileBackendStore extends FileBackend { return $this->doDirectoryExists( $fullCont, $dir, $params ); } else { // directory is on several shards wfDebug( __METHOD__ . ": iterating over all container shards.\n" ); - list( $b, $shortCont, $r ) = self::splitStoragePath( $params['dir'] ); + list( , $shortCont, ) = self::splitStoragePath( $params['dir'] ); $res = false; // response foreach ( $this->getContainerSuffixes( $shortCont ) as $suffix ) { $exists = $this->doDirectoryExists( "{$fullCont}{$suffix}", $dir, $params ); @@ -991,7 +991,7 @@ abstract class FileBackendStore extends FileBackend { } else { wfDebug( __METHOD__ . ": iterating over all container shards.\n" ); // File listing spans multiple containers/shards - list( $b, $shortCont, $r ) = self::splitStoragePath( $params['dir'] ); + list( , $shortCont, ) = self::splitStoragePath( $params['dir'] ); return new FileBackendStoreShardDirIterator( $this, $fullCont, $dir, $this->getContainerSuffixes( $shortCont ), $params ); } @@ -1024,7 +1024,7 @@ abstract class FileBackendStore extends FileBackend { } else { wfDebug( __METHOD__ . ": iterating over all container shards.\n" ); // File listing spans multiple containers/shards - list( $b, $shortCont, $r ) = self::splitStoragePath( $params['dir'] ); + list( , $shortCont, ) = self::splitStoragePath( $params['dir'] ); return new FileBackendStoreShardFileIterator( $this, $fullCont, $dir, $this->getContainerSuffixes( $shortCont ), $params ); } @@ -1302,7 +1302,7 @@ abstract class FileBackendStore extends FileBackend { final public function preloadCache( array $paths ) { $fullConts = array(); // full container names foreach ( $paths as $path ) { - list( $fullCont, $r, $s ) = $this->resolveStoragePath( $path ); + list( $fullCont, , ) = $this->resolveStoragePath( $path ); $fullConts[] = $fullCont; } // Load from the persistent file and container caches @@ -1465,7 +1465,7 @@ abstract class FileBackendStore extends FileBackend { * @return bool */ final public function isSingleShardPathInternal( $storagePath ) { - list( $c, $r, $shard ) = $this->resolveStoragePath( $storagePath ); + list( , , $shard ) = $this->resolveStoragePath( $storagePath ); return ( $shard !== null ); } @@ -1608,7 +1608,7 @@ abstract class FileBackendStore extends FileBackend { } // Get all the corresponding cache keys for paths... foreach ( $paths as $path ) { - list( $fullCont, $r, $s ) = $this->resolveStoragePath( $path ); + list( $fullCont, , ) = $this->resolveStoragePath( $path ); if ( $fullCont !== null ) { // valid path for this backend $contNames[$this->containerCacheKey( $fullCont )] = $fullCont; } @@ -1709,7 +1709,7 @@ abstract class FileBackendStore extends FileBackend { $paths = array_filter( $paths, 'strlen' ); // remove nulls // Get all the corresponding cache keys for paths... foreach ( $paths as $path ) { - list( $cont, $rel, $s ) = $this->resolveStoragePath( $path ); + list( , $rel, ) = $this->resolveStoragePath( $path ); if ( $rel !== null ) { // valid path for this backend $pathNames[$this->fileCacheKey( $path )] = $path; } diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index 283a820f9e..7344ffd642 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -634,7 +634,7 @@ class SwiftFileBackend extends FileBackendStore { // (a) Check if container already exists try { - $contObj = $this->getContainer( $fullCont ); + $this->getContainer( $fullCont ); // NoSuchContainerException not thrown: container must exist return $status; // already exists } catch ( NoSuchContainerException $e ) { @@ -869,8 +869,6 @@ class SwiftFileBackend extends FileBackendStore { try { $sContObj = $this->getContainer( $srcCont ); $obj = new CF_Object( $sContObj, $srcRel, false, false ); // skip HEAD - // Get source file extension - $ext = FileBackend::extensionFromPath( $path ); // Create a new temporary memory file... $handle = fopen( 'php://temp', 'wb' ); if ( $handle ) { diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 03d6ea97e0..357678247c 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -967,7 +967,6 @@ class FileRepo { $date = gmdate( "YmdHis" ); $hashPath = $this->getHashPath( $originalName ); - $dstRel = "{$hashPath}{$date}!{$originalName}"; $dstUrlRel = $hashPath . $date . '!' . rawurlencode( $originalName ); $virtualUrl = $this->getVirtualUrl( 'temp' ) . '/' . $dstUrlRel; @@ -1097,7 +1096,7 @@ class FileRepo { $operations = array(); $sourceFSFilesToDelete = array(); // cleanup for disk source files // Validate each triplet and get the store operation... - foreach ( $ntuples as $i => $ntuple ) { + foreach ( $ntuples as $ntuple ) { list( $srcPath, $dstRel, $archiveRel ) = $ntuple; $options = isset( $ntuple[3] ) ? $ntuple[3] : array(); // Resolve source to a storage path if virtual @@ -1176,7 +1175,7 @@ class FileRepo { $status->merge( $backend->doOperations( $operations ) ); // Find out which files were archived... foreach ( $ntuples as $i => $ntuple ) { - list( $srcPath, $dstRel, $archiveRel ) = $ntuple; + list( , , $archiveRel ) = $ntuple; $archivePath = $this->getZonePath( 'public' ) . "/$archiveRel"; if ( $this->fileExists( $archivePath ) ) { $status->value[$i] = 'archived'; @@ -1203,7 +1202,7 @@ class FileRepo { */ protected function initDirectory( $dir ) { $path = $this->resolveToStoragePath( $dir ); - list( $b, $container, $r ) = FileBackend::splitStoragePath( $path ); + list( , $container, ) = FileBackend::splitStoragePath( $path ); $params = array( 'dir' => $path ); if ( $this->isPrivate || $container === $this->zones['deleted']['container'] ) { diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index d9ba4e47cd..e4c8d96876 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -730,9 +730,8 @@ class LocalFile extends File { * RTT regression for wikis without 404 handling. */ function migrateThumbFile( $thumbName ) { - $thumbDir = $this->getThumbPath(); - /* Old code for bug 2532 + $thumbDir = $this->getThumbPath(); $thumbPath = "$thumbDir/$thumbName"; if ( is_dir( $thumbPath ) ) { // Directory where file should be @@ -1971,7 +1970,7 @@ class LocalFileDeleteBatch { $this->file->lock(); // Leave private files alone $privateFiles = array(); - list( $oldRels, $deleteCurrent ) = $this->getOldRels(); + list( $oldRels, ) = $this->getOldRels(); $dbw = $this->file->repo->getMasterDB(); if ( !empty( $oldRels ) ) { @@ -2049,7 +2048,7 @@ class LocalFileDeleteBatch { $files = $newBatch = array(); foreach ( $batch as $batchItem ) { - list( $src, $dest ) = $batchItem; + list( $src, ) = $batchItem; $files[$src] = $this->file->repo->getVirtualUrl( 'public' ) . '/' . rawurlencode( $src ); } diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 746cd12ac2..2a27735913 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -361,7 +361,7 @@ abstract class DatabaseUpdater { $func = $funcList[0]; $arg = $funcList[1]; $origParams = $funcList[2]; - $ret = call_user_func_array( $func, $arg ); + call_user_func_array( $func, $arg ); flush(); $this->updatesSkipped[] = $origParams; } diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index c1af27cc3d..e349b6abb1 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -988,7 +988,7 @@ abstract class Installer { continue; } - list( $all, $lang, $territory, $charset, $modifier ) = $m; + list( , $lang, , , ) = $m; $candidatesByLocale[$m[0]] = $m; $candidatesByLang[$lang][] = $m; diff --git a/includes/logging/LogEventsList.php b/includes/logging/LogEventsList.php index 47b2231924..df771e2531 100644 --- a/includes/logging/LogEventsList.php +++ b/includes/logging/LogEventsList.php @@ -307,7 +307,6 @@ class LogEventsList extends ContextSource { $formatter->setContext( $this->getContext() ); $formatter->setShowUserToolLinks( !( $this->flags & self::NO_EXTRA_USER_LINKS ) ); - $title = $entry->getTarget(); $time = htmlspecialchars( $this->getLanguage()->userTimeAndDate( $entry->getTimestamp(), $this->getUser() ) ); diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index 6c5b9835b8..d1da71014b 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -402,8 +402,10 @@ class LogFormatter { // Filter out parameters which are not in format #:foo foreach ( $entry->getParameters() as $key => $value ) { - if ( strpos( $key, ':' ) === false ) continue; - list( $index, $type, $name ) = explode( ':', $key, 3 ); + if ( strpos( $key, ':' ) === false ) { + continue; + } + list( $index, $type, ) = explode( ':', $key, 3 ); $params[$index - 1] = $this->formatParameterValue( $type, $value ); } diff --git a/includes/objectcache/DBABagOStuff.php b/includes/objectcache/DBABagOStuff.php index 51ce7776b3..c82b3aa484 100644 --- a/includes/objectcache/DBABagOStuff.php +++ b/includes/objectcache/DBABagOStuff.php @@ -251,7 +251,7 @@ class DBABagOStuff extends BagOStuff { # Insert failed, check to see if it failed due to an expired key if ( !$ret ) { - list( $value, $expiry ) = $this->decode( dba_fetch( $key, $handle ) ); + list( , $expiry ) = $this->decode( dba_fetch( $key, $handle ) ); if ( $expiry && $expiry < time() ) { # Yes expired, delete and try again diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 6270a8772d..2c46ee70c4 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -1540,8 +1540,7 @@ class Parser { $i = 0; while ( $imTagHooks[$name], array( $content, $attributes, $this, $frame ) ); } elseif ( isset( $this->mFunctionTagHooks[$name] ) ) { - list( $callback, $flags ) = $this->mFunctionTagHooks[$name]; + list( $callback, ) = $this->mFunctionTagHooks[$name]; if ( !is_callable( $callback ) ) { throw new MWException( "Tag hook for $name is not callable\n" ); } diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 569fde5db7..1ea903bd19 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -626,7 +626,7 @@ class ContribsPager extends ReverseChronologicalPager { $result = array(); // loop all results and collect them in an array - foreach ( $data as $j => $query ) { + foreach ( $data as $query ) { foreach ( $query as $i => $row ) { // use index column as key, allowing us to easily sort in PHP $result[$row->{$this->getIndexField()} . "-$i"] = $row; diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index b97a171888..942c337fce 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -447,9 +447,9 @@ class PageArchive { $makepage = false; # Page already exists. Import the history, and if necessary # we'll update the latest revision field in the record. - $newid = 0; - $pageId = $page->page_id; + $previousRevId = $page->page_latest; + # Get the time span of this page $previousTimestamp = $dbw->selectField( 'revision', 'rev_timestamp', array( 'rev_id' => $previousRevId ), @@ -532,10 +532,8 @@ class PageArchive { $revision = Revision::newFromArchiveRow( $row, array( 'title' => $article->getTitle(), // used to derive default content model - ) ); - - $m = $revision->getContentModel(); - + ) + ); $user = User::newFromName( $revision->getRawUserText(), false ); $content = $revision->getContent( Revision::RAW ); diff --git a/includes/specials/SpecialUploadStash.php b/includes/specials/SpecialUploadStash.php index 31f96699cb..a19f030d43 100644 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@ -327,14 +327,9 @@ class SpecialUploadStash extends UnlistedSpecialPage { /** * Default action when we don't have a subpage -- just show links to the uploads we have, * Also show a button to clear stashed files - * @param $status [optional] Status: the result of processRequest * @return bool */ - private function showUploads( $status = null ) { - if ( $status === null ) { - $status = Status::newGood(); - } - + private function showUploads() { // sets the title, etc. $this->setHeaders(); $this->outputHeader();