summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2022-01-24 06:47:31 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2022-01-24 06:47:31 +0000
commit57488328985a33c6b678742c08a839aaebdba380 (patch)
tree90affcb7b265eda29ebbcf858c4776f06ec425b7
parent176122db0b525cbddc2bae73c821b30a6481c036 (diff)
parent02766e0e27e9310b179612f6b7212863a540929a (diff)
Merge "recountCategories.php: Fix varibale shadowing"
-rw-r--r--maintenance/recountCategories.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/maintenance/recountCategories.php b/maintenance/recountCategories.php
index 93b70d2b1470..94d726020a24 100644
--- a/maintenance/recountCategories.php
+++ b/maintenance/recountCategories.php
@@ -75,15 +75,15 @@ TEXT
}
public function execute() {
- $mode = $this->getOption( 'mode' );
- if ( !in_array( $mode, [ 'pages', 'subcats', 'files', 'all' ] ) ) {
+ $originalMode = $this->getOption( 'mode' );
+ if ( !in_array( $originalMode, [ 'pages', 'subcats', 'files', 'all' ] ) ) {
$this->fatalError( 'Please specify a valid mode: one of "pages", "subcats", "files" or "all".' );
}
- if ( $mode === 'all' ) {
+ if ( $originalMode === 'all' ) {
$modes = [ 'pages', 'subcats', 'files' ];
} else {
- $modes = [ $mode ];
+ $modes = [ $originalMode ];
}
foreach ( $modes as $mode ) {
@@ -102,7 +102,7 @@ TEXT
// Finished
$this->output( "Done!\n" );
- if ( $mode !== 'all' ) {
+ if ( $originalMode !== 'all' ) {
$this->output( "Now run the script using the other --mode options if you haven't already.\n" );
}