maintenance: Deprecate Maintenance::hasArg/getArg with no param
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Thu, 28 Feb 2019 11:13:49 +0000 (12:13 +0100)
committerThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Fri, 29 Mar 2019 13:37:46 +0000 (14:37 +0100)
commit06c1a5976cf7733e9bee5ca673b658b6b88cb9f2
treeed2755216a5a616046072838bf571ec3a02ccef3
parent95e49195432aae0bf85c73ec43556d44f2fd828f
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
16 files changed:
RELEASE-NOTES-1.33
maintenance/Maintenance.php
maintenance/benchmarks/benchmarkParse.php
maintenance/cleanupSpam.php
maintenance/deleteBatch.php
maintenance/edit.php
maintenance/importDump.php
maintenance/jsparse.php
maintenance/mctest.php
maintenance/moveBatch.php
maintenance/nukePage.php
maintenance/pageExists.php
maintenance/protect.php
maintenance/storage/dumpRev.php
maintenance/undelete.php
maintenance/view.php