X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FuserOptions.inc;h=99ba3b8329ca6c7773bbfa0abb934911e8f665e4;hb=c54766586acab549f186e81eeab259845112809d;hp=5998cb59a1c2ff9c4fa5000960808c7b379473b7;hpb=a50a5d9da7a0a8c4030e8ad65cbb2a112024f8e9;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/userOptions.inc b/maintenance/userOptions.inc index 5998cb59a1..99ba3b8329 100644 --- a/maintenance/userOptions.inc +++ b/maintenance/userOptions.inc @@ -40,7 +40,11 @@ class UserOptions { private $mMode, $mReady; - /** Constructor. Will show usage and exit if script options are not correct */ + /** + * Constructor. Will show usage and exit if script options are not correct + * @param array $opts + * @param array $args + */ function __construct( $opts, $args ) { if ( !$this->checkOpts( $opts, $args ) ) { UserOptions::showUsageAndExit(); @@ -107,7 +111,8 @@ class UserOptions { return false; } - $this->{ $this->mMode } (); + $this->{$this->mMode}(); + return true; } @@ -139,7 +144,7 @@ class UserOptions { array( 'user_id' ), array(), __METHOD__ - ); + ); foreach ( $result as $id ) { @@ -159,7 +164,6 @@ class UserOptions { @$ret[$this->mAnOption][$userValue]++; // @codingStandardsIgnoreEnd } - } else { foreach ( $defaultOptions as $name => $defaultValue ) { @@ -192,7 +196,7 @@ class UserOptions { array( 'user_id' ), array(), __METHOD__ - ); + ); foreach ( $result as $id ) { @@ -218,7 +222,6 @@ class UserOptions { if ( !$this->mQuiet ) { print " OK\n"; } - } elseif ( !$this->mQuiet ) { print "Not changing '$username' using <{$this->mAnOption}> = '$curValue'\n"; } @@ -235,6 +238,7 @@ class UserOptions { foreach ( $def as $optname => $defaultValue ) { array_push( $ret, $optname ); } + return $ret; } @@ -243,7 +247,7 @@ class UserOptions { # public static function showUsageAndExit() { -print <<mAnOption> = '$this->mOldValue' will be made to use '$this->mNewValue'. Abort with control-c in the next five seconds.... WARN; wfCountDown( 5 ); + return true; } - }