X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FuserOptions.inc;h=4b0a817b5b164b6c289368a5352b5d6e3643bf8c;hb=df2ef5194e88514081511302da45ebf19afcb248;hp=99ba3b8329ca6c7773bbfa0abb934911e8f665e4;hpb=5c115a77890ce370d04eafd89005a028b9de8a40;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/userOptions.inc b/maintenance/userOptions.inc index 99ba3b8329..4b0a817b5b 100644 --- a/maintenance/userOptions.inc +++ b/maintenance/userOptions.inc @@ -22,8 +22,8 @@ */ // Options we will use -$options = array( 'list', 'nowarn', 'quiet', 'usage', 'dry' ); -$optionsWithArgs = array( 'old', 'new' ); +$options = [ 'list', 'nowarn', 'quiet', 'usage', 'dry' ]; +$optionsWithArgs = [ 'old', 'new' ]; require_once __DIR__ . '/commandLine.inc'; @@ -105,7 +105,9 @@ class UserOptions { return true; } - // Dumb stuff to run a mode. + /** + * Dumb stuff to run a mode. + */ public function run() { if ( !$this->mReady ) { return false; @@ -116,11 +118,9 @@ class UserOptions { return true; } - # - # Modes. - # - - /** List default options and their value */ + /** + * List default options and their value + */ private function LISTER() { $def = User::getDefaultOptions(); ksort( $def ); @@ -133,16 +133,18 @@ class UserOptions { } } - /** List options usage */ + /** + * List options usage + */ private function USAGER() { - $ret = array(); + $ret = []; $defaultOptions = User::getDefaultOptions(); // We list user by user_id from one of the slave database $dbr = wfGetDB( DB_SLAVE ); $result = $dbr->select( 'user', - array( 'user_id' ), - array(), + [ 'user_id' ], + [], __METHOD__ ); @@ -186,15 +188,17 @@ class UserOptions { } } - /** Change our users options */ + /** + * Change our users options + */ private function CHANGER() { $this->warn(); // We list user by user_id from one of the slave database $dbr = wfGetDB( DB_SLAVE ); $result = $dbr->select( 'user', - array( 'user_id' ), - array(), + [ 'user_id' ], + [], __METHOD__ ); @@ -234,7 +238,7 @@ class UserOptions { */ public static function getDefaultOptionsNames() { $def = User::getDefaultOptions(); - $ret = array(); + $ret = []; foreach ( $def as $optname => $defaultValue ) { array_push( $ret, $optname ); } @@ -242,10 +246,6 @@ class UserOptions { return $ret; } - # - # Helper methods - # - public static function showUsageAndExit() { print <<