X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fwatcheditem%2FNoWriteWatchedItemStore.php;h=69dcec854e0dcc380572d4403ece3516da11b62e;hb=4e9eb2f8d75784c78715e7dc3a9c8084d5c54943;hp=fc95ebc46e7c0ddb93a15a537f95be1a9e1ad9c8;hpb=27a6845c2a675990b04dfead674c0d46d140aa17;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/watcheditem/NoWriteWatchedItemStore.php b/includes/watcheditem/NoWriteWatchedItemStore.php index fc95ebc46e..69dcec854e 100644 --- a/includes/watcheditem/NoWriteWatchedItemStore.php +++ b/includes/watcheditem/NoWriteWatchedItemStore.php @@ -18,7 +18,9 @@ * @file * @ingroup Watchlist */ + use MediaWiki\Linker\LinkTarget; +use MediaWiki\User\UserIdentity; use Wikimedia\Rdbms\DBReadOnlyError; /** @@ -42,7 +44,7 @@ class NoWriteWatchedItemStore implements WatchedItemStoreInterface { $this->actualStore = $actualStore; } - public function countWatchedItems( User $user ) { + public function countWatchedItems( UserIdentity $user ) { return $this->actualStore->countWatchedItems( $user ); } @@ -55,7 +57,10 @@ class NoWriteWatchedItemStore implements WatchedItemStoreInterface { } public function countWatchersMultiple( array $targets, array $options = [] ) { - return $this->actualStore->countVisitingWatchersMultiple( $targets, $options ); + return $this->actualStore->countVisitingWatchersMultiple( + $targets, + $options['minimumWatchers'] ?? null + ); } public function countVisitingWatchersMultiple( @@ -68,27 +73,27 @@ class NoWriteWatchedItemStore implements WatchedItemStoreInterface { ); } - public function getWatchedItem( User $user, LinkTarget $target ) { + public function getWatchedItem( UserIdentity $user, LinkTarget $target ) { return $this->actualStore->getWatchedItem( $user, $target ); } - public function loadWatchedItem( User $user, LinkTarget $target ) { + public function loadWatchedItem( UserIdentity $user, LinkTarget $target ) { return $this->actualStore->loadWatchedItem( $user, $target ); } - public function getWatchedItemsForUser( User $user, array $options = [] ) { + public function getWatchedItemsForUser( UserIdentity $user, array $options = [] ) { return $this->actualStore->getWatchedItemsForUser( $user, $options ); } - public function isWatched( User $user, LinkTarget $target ) { + public function isWatched( UserIdentity $user, LinkTarget $target ) { return $this->actualStore->isWatched( $user, $target ); } - public function getNotificationTimestampsBatch( User $user, array $targets ) { + public function getNotificationTimestampsBatch( UserIdentity $user, array $targets ) { return $this->actualStore->getNotificationTimestampsBatch( $user, $targets ); } - public function countUnreadNotifications( User $user, $unreadLimit = null ) { + public function countUnreadNotifications( UserIdentity $user, $unreadLimit = null ) { return $this->actualStore->countUnreadNotifications( $user, $unreadLimit ); } @@ -100,56 +105,60 @@ class NoWriteWatchedItemStore implements WatchedItemStoreInterface { throw new DBReadOnlyError( null, self::DB_READONLY_ERROR ); } - public function addWatch( User $user, LinkTarget $target ) { + public function addWatch( UserIdentity $user, LinkTarget $target ) { throw new DBReadOnlyError( null, self::DB_READONLY_ERROR ); } - public function addWatchBatchForUser( User $user, array $targets ) { + public function addWatchBatchForUser( UserIdentity $user, array $targets ) { throw new DBReadOnlyError( null, self::DB_READONLY_ERROR ); } - public function removeWatch( User $user, LinkTarget $target ) { + public function removeWatch( UserIdentity $user, LinkTarget $target ) { throw new DBReadOnlyError( null, self::DB_READONLY_ERROR ); } public function setNotificationTimestampsForUser( - User $user, + UserIdentity $user, $timestamp, array $targets = [] ) { throw new DBReadOnlyError( null, self::DB_READONLY_ERROR ); } - public function updateNotificationTimestamp( User $editor, LinkTarget $target, $timestamp ) { + public function updateNotificationTimestamp( + UserIdentity $editor, LinkTarget $target, $timestamp + ) { throw new DBReadOnlyError( null, self::DB_READONLY_ERROR ); } - public function resetAllNotificationTimestampsForUser( User $user ) { + public function resetAllNotificationTimestampsForUser( UserIdentity $user ) { throw new DBReadOnlyError( null, self::DB_READONLY_ERROR ); } public function resetNotificationTimestamp( - User $user, - Title $title, + UserIdentity $user, + LinkTarget $title, $force = '', $oldid = 0 ) { throw new DBReadOnlyError( null, self::DB_READONLY_ERROR ); } - public function clearUserWatchedItems( User $user ) { + public function clearUserWatchedItems( UserIdentity $user ) { throw new DBReadOnlyError( null, self::DB_READONLY_ERROR ); } - public function clearUserWatchedItemsUsingJobQueue( User $user ) { + public function clearUserWatchedItemsUsingJobQueue( UserIdentity $user ) { throw new DBReadOnlyError( null, self::DB_READONLY_ERROR ); } - public function removeWatchBatchForUser( User $user, array $titles ) { + public function removeWatchBatchForUser( UserIdentity $user, array $titles ) { throw new DBReadOnlyError( null, self::DB_READONLY_ERROR ); } - public function getLatestNotificationTimestamp( $timestamp, User $user, LinkTarget $target ) { + public function getLatestNotificationTimestamp( + $timestamp, UserIdentity $user, LinkTarget $target + ) { return wfTimestampOrNull( TS_MW, $timestamp ); } }