X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=maintenance%2FcleanupWatchlist.php;h=64d39dd6c88565c750533be714a7192b5b5ebd0e;hp=16f7b616de727d51680e3e6fa12d9f97f69243cc;hb=74426f3cf796b149f1ae445e41815bbe148640b2;hpb=e4854a1f0057ac344e2b5c6656ac186fcd8dc3fa diff --git a/maintenance/cleanupWatchlist.php b/maintenance/cleanupWatchlist.php index 16f7b616de..64d39dd6c8 100644 --- a/maintenance/cleanupWatchlist.php +++ b/maintenance/cleanupWatchlist.php @@ -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;