X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FuserOptions.inc;h=ddbda49cd203c0b900d218099c2af87d51ec23f3;hb=c752c43a374a49fe77dacac5a0a514c5a43f838b;hp=cbe6b057b4a9d0b9c9c0855d0e05ca92c22030db;hpb=6ad44a315abcb390e930320d5d40db6ff789aad3;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/userOptions.inc b/maintenance/userOptions.inc index cbe6b057b4..ddbda49cd2 100644 --- a/maintenance/userOptions.inc +++ b/maintenance/userOptions.inc @@ -38,7 +38,7 @@ class userOptions { public $mOldValue; public $mNewValue; - private $mMode, $mReady ; + private $mMode, $mReady; /** Constructor. Will show usage and exit if script options are not correct */ function __construct( $opts, $args ) { @@ -60,9 +60,9 @@ class userOptions { */ private function checkOpts( $opts, $args ) { // The three possible ways to run the script: - $list = isset( $opts['list'] ); - $usage = isset( $opts['usage'] ) && ( count( $args ) <= 1 ); - $change = isset( $opts['old'] ) && isset( $opts['new'] ) && ( count( $args ) <= 1 ) ; + $list = isset( $opts['list'] ); + $usage = isset( $opts['usage'] ) && ( count( $args ) <= 1 ); + $change = isset( $opts['old'] ) && isset( $opts['new'] ) && ( count( $args ) <= 1 ); // We want only one of them $isValid = ( ( $list + $usage + $change ) == 1 ); @@ -82,18 +82,18 @@ class userOptions { $this->mQuick = isset( $opts['nowarn'] ); $this->mQuiet = isset( $opts['quiet'] ); - $this->mDry = isset( $opts['dry'] ); + $this->mDry = isset( $opts['dry'] ); // Set object properties, specially 'mMode' used by run() if ( isset( $opts['list'] ) ) { - $this->mMode = 'LISTER' ; + $this->mMode = 'LISTER'; } elseif ( isset( $opts['usage'] ) ) { - $this->mMode = 'USAGER' ; - $this->mAnOption = isset( $args[0] ) ? $args[0] : false ; + $this->mMode = 'USAGER'; + $this->mAnOption = isset( $args[0] ) ? $args[0] : false; } elseif ( isset( $opts['old'] ) && isset( $opts['new'] ) ) { - $this->mMode = 'CHANGER' ; - $this->mOldValue = $opts['old'] ; - $this->mNewValue = $opts['new'] ; + $this->mMode = 'CHANGER'; + $this->mOldValue = $opts['old']; + $this->mNewValue = $opts['new']; $this->mAnOption = $args[0]; } else { die( "There is a bug in the software, this should never happen\n" ); @@ -212,7 +212,9 @@ class userOptions { if ( !$this->mDry ) { $user->saveSettings(); } - if ( !$this->mQuiet ) { print " OK\n"; } + if ( !$this->mQuiet ) { + print " OK\n"; + } } elseif ( !$this->mQuiet ) { print "Not changing '$username' using <{$this->mAnOption}> = '$curValue'\n";