From 02766e0e27e9310b179612f6b7212863a540929a Mon Sep 17 00:00:00 2001 From: Ammarpad Date: Sun, 23 Jan 2022 13:12:04 +0100 Subject: recountCategories.php: Fix varibale shadowing Change-Id: I9333afad473836c1e3abf2bdd0d8841830a7e523 --- maintenance/recountCategories.php | 10 +++++----- 1 file 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" ); } -- cgit v1.2.3