diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 5be05d1022e..4f3e928ced4 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1432,7 +1432,6 @@ function wfClientAcceptsGzip( $force = false ) { ) ) { if ( isset( $m[2] ) && ( $m[1] == 'q' ) && ( $m[2] == 0 ) ) { - $result = false; return $result; } wfDebug( "wfClientAcceptsGzip: client accepts gzip." ); diff --git a/includes/Revision/ContributionsLookup.php b/includes/Revision/ContributionsLookup.php index 83ff0d8d09e..5ed623f0298 100644 --- a/includes/Revision/ContributionsLookup.php +++ b/includes/Revision/ContributionsLookup.php @@ -89,7 +89,6 @@ class ContributionsLookup { $dir = 'prev'; $segment = $seg[1]; } elseif ( $seg[0] == 'before' ) { - $dir = 'next'; $segment = $seg[1]; } else { $dir = null; diff --git a/includes/actions/RawAction.php b/includes/actions/RawAction.php index ff3e521b674..a5d66b45fc8 100644 --- a/includes/actions/RawAction.php +++ b/includes/actions/RawAction.php @@ -232,7 +232,6 @@ class RawAction extends FormlessAction { if ( $content === null ) { // revision not found (or suppressed) - $text = false; } elseif ( !$content instanceof TextContent ) { // non-text content wfHttpError( 415, "Unsupported Media Type", "The requested page uses the content model `" @@ -247,7 +246,6 @@ class RawAction extends FormlessAction { if ( $content === null || $content === false ) { // section not found (or section not supported, e.g. for JS, JSON, and CSS) - $text = false; } else { $text = $content->getText(); } diff --git a/includes/libs/objectcache/MemcachedPeclBagOStuff.php b/includes/libs/objectcache/MemcachedPeclBagOStuff.php index e570b8e3593..f9a403c2f86 100644 --- a/includes/libs/objectcache/MemcachedPeclBagOStuff.php +++ b/includes/libs/objectcache/MemcachedPeclBagOStuff.php @@ -196,7 +196,6 @@ class MemcachedPeclBagOStuff extends MemcachedBagOStuff { $casToken = $res['cas']; } else { $result = false; - $casToken = null; } } else { $result = $client->get( $routeKey ); diff --git a/includes/preferences/DefaultPreferencesFactory.php b/includes/preferences/DefaultPreferencesFactory.php index 72291911ab3..3bbd782aced 100644 --- a/includes/preferences/DefaultPreferencesFactory.php +++ b/includes/preferences/DefaultPreferencesFactory.php @@ -729,7 +729,6 @@ class DefaultPreferencesFactory implements PreferencesFactory { $t = $lang->userTime( $emailTimestamp, $displayUser ); $emailauthenticated = $context->msg( 'emailauthenticated', $time, $d, $t )->parse() . '
'; - $disableEmailPrefs = false; $emailauthenticationclass = 'mw-email-authenticated'; } else { $disableEmailPrefs = true; diff --git a/includes/resourceloader/ResourceLoaderClientHtml.php b/includes/resourceloader/ResourceLoaderClientHtml.php index 4d31015e01a..0c2e69050bf 100644 --- a/includes/resourceloader/ResourceLoaderClientHtml.php +++ b/includes/resourceloader/ResourceLoaderClientHtml.php @@ -395,7 +395,6 @@ JAVASCRIPT; sort( $modules ); if ( $mainContext->getDebug() && count( $modules ) > 1 ) { - $chunks = []; // Recursively call us for every item foreach ( $modules as $name ) { $chunks[] = self::makeLoad( $mainContext, [ $name ], $only, $extraQuery, $nonce ); diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index 268d9ace65e..334f91396c3 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -419,7 +419,6 @@ abstract class SearchEngine { foreach ( $allkeywords as $kw ) { if ( strncmp( $query, $kw, strlen( $kw ) ) == 0 ) { - $extractedNamespace = null; $parsed = substr( $query, strlen( $kw ) ); $allQuery = true; break; diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index ab60600faec..cfae60d2c84 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -857,7 +857,6 @@ class SpecialBlock extends FormSpecialPage { if ( $isPartialBlock ) { if ( isset( $data['PageRestrictions'] ) && $data['PageRestrictions'] !== '' ) { $titles = explode( "\n", $data['PageRestrictions'] ); - $pageRestrictions = []; foreach ( $titles as $title ) { $pageRestrictions[] = PageRestriction::newFromTitle( $title ); } diff --git a/maintenance/fixMergeHistoryCorruption.php b/maintenance/fixMergeHistoryCorruption.php index 896830c51c7..ef2d7bb259f 100644 --- a/maintenance/fixMergeHistoryCorruption.php +++ b/maintenance/fixMergeHistoryCorruption.php @@ -53,11 +53,9 @@ class FixMergeHistoryCorruption extends Maintenance { $dryRun = true; if ( $this->hasOption( 'dry-run' ) && $this->hasOption( 'delete' ) ) { $this->fatalError( 'Cannot do both --dry-run and --delete.' ); - } elseif ( $this->hasOption( 'dry-run' ) ) { - $dryRun = true; } elseif ( $this->hasOption( 'delete' ) ) { $dryRun = false; - } else { + } elseif ( !$this->hasOption( 'dry-run' ) ) { $this->fatalError( 'Either --dry-run or --delete must be specified.' ); } diff --git a/maintenance/getConfiguration.php b/maintenance/getConfiguration.php index b2e1c57bdd1..972167a4fde 100644 --- a/maintenance/getConfiguration.php +++ b/maintenance/getConfiguration.php @@ -122,7 +122,6 @@ class GetConfiguration extends Maintenance { # Filter out globals based on the regex if ( $this->regex ) { - $res = []; foreach ( $GLOBALS as $name => $value ) { if ( preg_match( $this->regex, $name ) ) { $res[$name] = $value;