* @ingroup Maintenance
*/
class CreateAndPromote extends Maintenance {
- private static $permitRoles = array( 'sysop', 'bureaucrat', 'bot' );
+ private static $permitRoles = [ 'sysop', 'bureaucrat', 'bot' ];
public function __construct() {
parent::__construct();
$username = $this->getArg( 0 );
$password = $this->getArg( 1 );
$force = $this->hasOption( 'force' );
- $inGroups = array();
+ $inGroups = [];
$user = User::newFromName( $username );
if ( !is_object( $user ) ) {
$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 !== '' ) {
}
# Promote user
- array_map( array( $user, 'addGroup' ), $promotions );
+ array_map( [ $user, 'addGroup' ], $promotions );
if ( !$exists ) {
# Increment site_stats.ss_users