Merge "registration: Support Change/RemoveCredentialsBlacklist in extension.json"
[lhc/web/wiklou.git] / includes / specials / SpecialEditWatchlist.php
index f2fa921..627dd2c 100644 (file)
@@ -27,6 +27,8 @@ use MediaWiki\Linker\LinkTarget;
  * @ingroup Watchlist
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Provides the UI through which users can perform editing
  * operations on their watchlist
@@ -325,7 +327,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
        private function getWatchlist() {
                $list = [];
 
-               $watchedItems = WatchedItemStore::getDefaultInstance()->getWatchedItemsForUser(
+               $watchedItems = MediaWikiServices::getInstance()->getWatchedItemStore()->getWatchedItemsForUser(
                        $this->getUser(),
                        [ 'forWrite' => $this->getRequest()->wasPosted() ]
                );
@@ -366,7 +368,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
        protected function getWatchlistInfo() {
                $titles = [];
 
-               $watchedItems = WatchedItemStore::getDefaultInstance()
+               $watchedItems = MediaWikiServices::getInstance()->getWatchedItemStore()
                        ->getWatchedItemsForUser( $this->getUser(), [ 'sort' => WatchedItemStore::SORT_ASC ] );
 
                $lb = new LinkBatch();
@@ -421,7 +423,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                }
 
                $user = $this->getUser();
-               $store = WatchedItemStore::getDefaultInstance();
+               $store = MediaWikiServices::getInstance()->getWatchedItemStore();
 
                foreach ( $this->badItems as $row ) {
                        list( $title, $namespace, $dbKey ) = $row;
@@ -472,7 +474,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
                        $expandedTargets[] = new TitleValue( MWNamespace::getTalk( $ns ), $dbKey );
                }
 
-               WatchedItemStore::getDefaultInstance()->addWatchBatchForUser(
+               MediaWikiServices::getInstance()->getWatchedItemStore()->addWatchBatchForUser(
                        $this->getUser(),
                        $expandedTargets
                );
@@ -487,7 +489,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
         * @param array $titles Array of strings, or Title objects
         */
        private function unwatchTitles( $titles ) {
-               $store = WatchedItemStore::getDefaultInstance();
+               $store = MediaWikiServices::getInstance()->getWatchedItemStore();
 
                foreach ( $titles as $title ) {
                        if ( !$title instanceof Title ) {