Merge "Depedency inject remappedTableName() map via MWLBFactory"
[lhc/web/wiklou.git] / maintenance / createCommonPasswordCdb.php
index c678712..388ad8a 100644 (file)
@@ -37,7 +37,7 @@ class GenerateCommonPassword extends Maintenance {
        public function __construct() {
                global $IP;
                parent::__construct();
-               $this->mDescription = "Generate CDB file of common passwords";
+               $this->addDescription( 'Generate CDB file of common passwords' );
                $this->addOption( 'limit', "Max number of passwords to write", false, true, 'l' );
                $this->addArg( 'inputfile', 'List of passwords (one per line) to use or - for stdin', true );
                $this->addArg(
@@ -69,7 +69,7 @@ class GenerateCommonPassword extends Maintenance {
                try {
                        $db = \Cdb\Writer::open( $outfile );
 
-                       $alreadyWritten = array();
+                       $alreadyWritten = [];
                        $skipped = 0;
                        for ( $i = 0; ( $i - $skipped ) < $limit; $i++ ) {
                                if ( feof( $file ) ) {
@@ -109,7 +109,6 @@ class GenerateCommonPassword extends Maintenance {
                } catch ( \Cdb\Exception $e ) {
                        $this->error( "Error writing cdb file: " . $e->getMessage(), 2 );
                }
-
        }
 }