X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=maintenance%2FcreateAndPromote.php;h=9abc297dc3f8cd656fb3cea9c8a6675ae748cacd;hb=2379efaad6bddc93e7f08ca42f017890169b44e4;hp=e7d666a56271a3d09701d5d72ebe117fc783451b;hpb=59db24e90bc6027cb8bf2756eb8cb52230d24966;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/createAndPromote.php b/maintenance/createAndPromote.php index e7d666a562..9abc297dc3 100644 --- a/maintenance/createAndPromote.php +++ b/maintenance/createAndPromote.php @@ -31,7 +31,7 @@ require_once __DIR__ . '/Maintenance.php'; * @ingroup Maintenance */ class CreateAndPromote extends Maintenance { - private static $permitRoles = array( 'sysop', 'bureaucrat', 'bot' ); + private static $permitRoles = [ 'sysop', 'bureaucrat', 'bot' ]; public function __construct() { parent::__construct(); @@ -59,7 +59,7 @@ class CreateAndPromote extends Maintenance { $username = $this->getArg( 0 ); $password = $this->getArg( 1 ); $force = $this->hasOption( 'force' ); - $inGroups = array(); + $inGroups = []; $user = User::newFromName( $username ); if ( !is_object( $user ) ) { @@ -77,7 +77,7 @@ class CreateAndPromote extends Maintenance { $inGroups = $user->getGroups(); } - $groups = array_filter( self::$permitRoles, array( $this, 'hasOption' ) ); + $groups = array_filter( self::$permitRoles, [ $this, 'hasOption' ] ); if ( $this->hasOption( 'custom-groups' ) ) { $customGroupsText = $this->getOption( 'custom-groups' ); if ( $customGroupsText !== '' ) { @@ -126,7 +126,7 @@ class CreateAndPromote extends Maintenance { } # Promote user - array_map( array( $user, 'addGroup' ), $promotions ); + array_map( [ $user, 'addGroup' ], $promotions ); if ( !$exists ) { # Increment site_stats.ss_users