Merge "mw.Feedback: If the message is posted remotely, link the title correctly"
[lhc/web/wiklou.git] / maintenance / cleanupWatchlist.php
index 16f7b61..64d39dd 100644 (file)
@@ -37,16 +37,16 @@ require_once __DIR__ . '/cleanupTable.inc';
  * @ingroup Maintenance
  */
 class WatchlistCleanup extends TableCleanup {
-       protected $defaultParams = array(
+       protected $defaultParams = [
                'table' => 'watchlist',
-               'index' => array( 'wl_user', 'wl_namespace', 'wl_title' ),
-               'conds' => array(),
+               'index' => [ 'wl_user', 'wl_namespace', 'wl_title' ],
+               'conds' => [],
                'callback' => 'processRow'
-       );
+       ];
 
        public function __construct() {
                parent::__construct();
-               $this->mDescription = "Script to remove broken, unparseable titles in the Watchlist";
+               $this->addDescription( 'Script to remove broken, unparseable titles in the Watchlist' );
                $this->addOption( 'fix', 'Actually remove entries; without will only report.' );
        }
 
@@ -79,10 +79,10 @@ class WatchlistCleanup extends TableCleanup {
                if ( !$this->dryrun && $this->hasOption( 'fix' ) ) {
                        $dbw = $this->getDB( DB_MASTER );
                        $dbw->delete(
-                               'watchlist', array(
+                               'watchlist', [
                                'wl_user' => $row->wl_user,
                                'wl_namespace' => $row->wl_namespace,
-                               'wl_title' => $row->wl_title ),
+                               'wl_title' => $row->wl_title ],
                                __METHOD__
                        );
 
@@ -95,5 +95,5 @@ class WatchlistCleanup extends TableCleanup {
        }
 }
 
-$maintClass = "WatchlistCleanup";
+$maintClass = WatchlistCleanup::class;
 require_once RUN_MAINTENANCE_IF_MAIN;