dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert WatchedItem and friends to LinkTarget
[lhc/web/wiklou.git]
/
includes
/
watcheditem
/
NoWriteWatchedItemStore.php
diff --git
a/includes/watcheditem/NoWriteWatchedItemStore.php
b/includes/watcheditem/NoWriteWatchedItemStore.php
index
2801207
..
72f6086
100644
(file)
--- a/
includes/watcheditem/NoWriteWatchedItemStore.php
+++ b/
includes/watcheditem/NoWriteWatchedItemStore.php
@@
-18,7
+18,9
@@
* @file
* @ingroup Watchlist
*/
* @file
* @ingroup Watchlist
*/
+
use MediaWiki\Linker\LinkTarget;
use MediaWiki\Linker\LinkTarget;
+use MediaWiki\User\UserIdentity;
use Wikimedia\Rdbms\DBReadOnlyError;
/**
use Wikimedia\Rdbms\DBReadOnlyError;
/**
@@
-32,9
+34,6
@@
class NoWriteWatchedItemStore implements WatchedItemStoreInterface {
*/
private $actualStore;
*/
private $actualStore;
- /**
- * @var string
- */
const DB_READONLY_ERROR = 'The watchlist is currently readonly.';
/**
const DB_READONLY_ERROR = 'The watchlist is currently readonly.';
/**
@@
-45,7
+44,7
@@
class NoWriteWatchedItemStore implements WatchedItemStoreInterface {
$this->actualStore = $actualStore;
}
$this->actualStore = $actualStore;
}
- public function countWatchedItems( User $user ) {
+ public function countWatchedItems( User
Identity
$user ) {
return $this->actualStore->countWatchedItems( $user );
}
return $this->actualStore->countWatchedItems( $user );
}
@@
-71,27
+70,27
@@
class NoWriteWatchedItemStore implements WatchedItemStoreInterface {
);
}
);
}
- public function getWatchedItem( User $user, LinkTarget $target ) {
+ public function getWatchedItem( User
Identity
$user, LinkTarget $target ) {
return $this->actualStore->getWatchedItem( $user, $target );
}
return $this->actualStore->getWatchedItem( $user, $target );
}
- public function loadWatchedItem( User $user, LinkTarget $target ) {
+ public function loadWatchedItem( User
Identity
$user, LinkTarget $target ) {
return $this->actualStore->loadWatchedItem( $user, $target );
}
return $this->actualStore->loadWatchedItem( $user, $target );
}
- public function getWatchedItemsForUser( User $user, array $options = [] ) {
+ public function getWatchedItemsForUser( User
Identity
$user, array $options = [] ) {
return $this->actualStore->getWatchedItemsForUser( $user, $options );
}
return $this->actualStore->getWatchedItemsForUser( $user, $options );
}
- public function isWatched( User $user, LinkTarget $target ) {
+ public function isWatched( User
Identity
$user, LinkTarget $target ) {
return $this->actualStore->isWatched( $user, $target );
}
return $this->actualStore->isWatched( $user, $target );
}
- public function getNotificationTimestampsBatch( User $user, array $targets ) {
+ public function getNotificationTimestampsBatch( User
Identity
$user, array $targets ) {
return $this->actualStore->getNotificationTimestampsBatch( $user, $targets );
}
return $this->actualStore->getNotificationTimestampsBatch( $user, $targets );
}
- public function countUnreadNotifications( User $user, $unreadLimit = null ) {
+ public function countUnreadNotifications( User
Identity
$user, $unreadLimit = null ) {
return $this->actualStore->countUnreadNotifications( $user, $unreadLimit );
}
return $this->actualStore->countUnreadNotifications( $user, $unreadLimit );
}
@@
-103,53
+102,60
@@
class NoWriteWatchedItemStore implements WatchedItemStoreInterface {
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
- public function addWatch( User $user, LinkTarget $target ) {
+ public function addWatch( User
Identity
$user, LinkTarget $target ) {
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
- public function addWatchBatchForUser( User $user, array $targets ) {
+ public function addWatchBatchForUser( User
Identity
$user, array $targets ) {
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
- public function removeWatch( User $user, LinkTarget $target ) {
+ public function removeWatch( User
Identity
$user, LinkTarget $target ) {
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
public function setNotificationTimestampsForUser(
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
public function setNotificationTimestampsForUser(
- User $user,
+ User
Identity
$user,
$timestamp,
array $targets = []
) {
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
$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 );
}
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
- public function resetAllNotificationTimestampsForUser( User $user ) {
+ public function resetAllNotificationTimestampsForUser( User
Identity
$user ) {
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
public function resetNotificationTimestamp(
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
public function resetNotificationTimestamp(
- User $user,
-
Title
$title,
+ User
Identity
$user,
+
LinkTarget
$title,
$force = '',
$oldid = 0
) {
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
$force = '',
$oldid = 0
) {
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
- public function clearUserWatchedItems( User $user ) {
+ public function clearUserWatchedItems( User
Identity
$user ) {
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
- public function clearUserWatchedItemsUsingJobQueue( User $user ) {
+ public function clearUserWatchedItemsUsingJobQueue( User
Identity
$user ) {
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
- public function removeWatchBatchForUser( User $user, array $titles ) {
+ public function removeWatchBatchForUser( User
Identity
$user, array $titles ) {
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
throw new DBReadOnlyError( null, self::DB_READONLY_ERROR );
}
+ public function getLatestNotificationTimestamp(
+ $timestamp, UserIdentity $user, LinkTarget $target
+ ) {
+ return wfTimestampOrNull( TS_MW, $timestamp );
+ }
}
}