aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/nukePage.php
diff options
context:
space:
mode:
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>2019-02-28 12:13:49 +0100
committerThiemo Kreuz <thiemo.kreuz@wikimedia.de>2019-03-29 14:37:46 +0100
commit06c1a5976cf7733e9bee5ca673b658b6b88cb9f2 (patch)
treeed2755216a5a616046072838bf571ec3a02ccef3 /maintenance/nukePage.php
parent95e49195432aae0bf85c73ec43556d44f2fd828f (diff)
downloadmediawikicore-06c1a5976cf7733e9bee5ca673b658b6b88cb9f2.tar.gz
mediawikicore-06c1a5976cf7733e9bee5ca673b658b6b88cb9f2.zip
maintenance: Deprecate Maintenance::hasArg/getArg with no param
Benefit of keeping the parameter optional: - In maintenance scripts that really only have one parameter, it's a little more convenient to be able to ask for *the* parameter via an empty getArg(). Disadvantages: - It's unclear what getArg() means when there is no indication *which* argument the code asks for. This might as well return the last argument, or an array of all arguments. - In scripts with two or more arguments, it's confusing to see getArg( 1 ) next to an empty getArg(). - The methods are more complex and a bit more complicated to use with the extra feature of this parameter being optional. Users need to look up what the default is to be able to use it safely. Change-Id: I22a43bfdfc0f0c9ffdb468c13aba73b888d1f15e
Diffstat (limited to 'maintenance/nukePage.php')
-rw-r--r--maintenance/nukePage.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/maintenance/nukePage.php b/maintenance/nukePage.php
index baead9476c10..ba0fe5da5db3 100644
--- a/maintenance/nukePage.php
+++ b/maintenance/nukePage.php
@@ -39,7 +39,7 @@ class NukePage extends Maintenance {
}
public function execute() {
- $name = $this->getArg();
+ $name = $this->getArg( 0 );
$delete = $this->hasOption( 'delete' );
$dbw = $this->getDB( DB_MASTER );