Merge "Selenium: replace UserLoginPage with BlankPage where possible"
[lhc/web/wiklou.git] / includes / watcheditem / WatchedItemStore.php
index 8560624..1a39945 100644 (file)
@@ -553,7 +553,7 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac
         * @since 1.27
         * @param UserIdentity $user
         * @param LinkTarget $target
-        * @return bool
+        * @return WatchedItem|false
         */
        public function getWatchedItem( UserIdentity $user, LinkTarget $target ) {
                if ( !$user->isRegistered() ) {
@@ -573,7 +573,7 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac
         * @since 1.27
         * @param UserIdentity $user
         * @param LinkTarget $target
-        * @return WatchedItem|bool
+        * @return WatchedItem|false
         */
        public function loadWatchedItem( UserIdentity $user, LinkTarget $target ) {
                // Only registered user can have a watchlist
@@ -641,7 +641,7 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac
                        // @todo: Should we add these to the process cache?
                        $watchedItems[] = new WatchedItem(
                                $user,
-                               new TitleValue( (int)$row->wl_namespace, $row->wl_title ),
+                               $target,
                                $this->getLatestNotificationTimestamp(
                                        $row->wl_notificationtimestamp, $user, $target )
                        );
@@ -769,7 +769,7 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac
                foreach ( $rowBatches as $toInsert ) {
                        // Use INSERT IGNORE to avoid overwriting the notification timestamp
                        // if there's already an entry for this page
-                       $dbw->insert( 'watchlist', $toInsert, __METHOD__, 'IGNORE' );
+                       $dbw->insert( 'watchlist', $toInsert, __METHOD__, [ 'IGNORE' ] );
                        $affectedRows += $dbw->affectedRows();
                        if ( $ticket ) {
                                $this->lbFactory->commitAndWaitForReplication( __METHOD__, $ticket );