/**
* Main execution point
*
- * @param User $user
- * @param OutputPage $output
- * @param WebRequest $request
- * @param int $mode
+ * @param $user User
+ * @param $output OutputPage
+ * @param $request WebRequest
+ * @param $mode int
*/
public function execute( $user, $output, $request, $mode ) {
global $wgUser;
/**
* Check the edit token from a form submission
*
- * @param WebRequest $request
- * @param User $user
+ * @param $request WebRequest
+ * @param $user User
* @return bool
*/
private function checkToken( $request, $user ) {
* Extract a list of titles from a blob of text, returning
* (prefixed) strings; unwatchable titles are ignored
*
- * @param mixed $list
+ * @param $list mixed
* @return array
*/
private function extractTitles( $list ) {
* $titles can be an array of strings or Title objects; the former
* is preferred, since Titles are very memory-heavy
*
- * @param array $titles An array of strings, or Title objects
- * @param OutputPage $output
- * @param Skin $skin
+ * @param $titles An array of strings, or Title objects
+ * @param $output OutputPage
+ * @param $skin Skin
*/
private function showTitles( $titles, $output, $skin ) {
$talk = wfMsgHtml( 'talkpagelinktext' );
/**
* Count the number of titles on a user's watchlist, excluding talk pages
*
- * @param User $user
+ * @param $user User
* @return int
*/
private function countWatchlist( $user ) {
$dbr = wfGetDB( DB_MASTER );
- $res = $dbr->select( 'watchlist', 'COUNT(*) AS count', array( 'wl_user' => $user->getID() ), __METHOD__ );
+ $res = $dbr->select( 'watchlist', 'COUNT(*) AS count', array( 'wl_user' => $user->getId() ), __METHOD__ );
$row = $dbr->fetchObject( $res );
return ceil( $row->count / 2 ); // Paranoia
}
* Prepare a list of titles on a user's watchlist (excluding talk pages)
* and return an array of (prefixed) strings
*
- * @param User $user
+ * @param $user User
* @return array
*/
private function getWatchlist( $user ) {
'watchlist',
'*',
array(
- 'wl_user' => $user->getID(),
+ 'wl_user' => $user->getId(),
),
__METHOD__
);
* and return as a two-dimensional array with namespace, title and
* redirect status
*
- * @param User $user
+ * @param $user User
* @return array
*/
private function getWatchlistInfo( $user ) {
$titles = array();
$dbr = wfGetDB( DB_MASTER );
- $uid = intval( $user->getID() );
+ $uid = intval( $user->getId() );
list( $watchlist, $page ) = $dbr->tableNamesN( 'watchlist', 'page' );
$sql = "SELECT wl_namespace, wl_title, page_id, page_len, page_is_redirect
FROM {$watchlist} LEFT JOIN {$page} ON ( wl_namespace = page_namespace
* Show a message indicating the number of items on the user's watchlist,
* and return this count for additional checking
*
- * @param OutputPage $output
- * @param User $user
+ * @param $output OutputPage
+ * @param $user User
* @return int
*/
private function showItemCount( $output, $user ) {
/**
* Remove all titles from a user's watchlist
*
- * @param User $user
+ * @param $user User
*/
private function clearWatchlist( $user ) {
$dbw = wfGetDB( DB_MASTER );
- $dbw->delete( 'watchlist', array( 'wl_user' => $user->getID() ), __METHOD__ );
+ $dbw->delete( 'watchlist', array( 'wl_user' => $user->getId() ), __METHOD__ );
}
/**
* $titles can be an array of strings or Title objects; the former
* is preferred, since Titles are very memory-heavy
*
- * @param array $titles An array of strings, or Title objects
- * @param User $user
+ * @param $titles An array of strings, or Title objects
+ * @param $user User
*/
private function watchTitles( $titles, $user ) {
$dbw = wfGetDB( DB_MASTER );
$title = Title::newFromText( $title );
if( $title instanceof Title ) {
$rows[] = array(
- 'wl_user' => $user->getID(),
+ 'wl_user' => $user->getId(),
'wl_namespace' => ( $title->getNamespace() & ~1 ),
'wl_title' => $title->getDBkey(),
'wl_notificationtimestamp' => null,
);
$rows[] = array(
- 'wl_user' => $user->getID(),
+ 'wl_user' => $user->getId(),
'wl_namespace' => ( $title->getNamespace() | 1 ),
'wl_title' => $title->getDBkey(),
'wl_notificationtimestamp' => null,
* $titles can be an array of strings or Title objects; the former
* is preferred, since Titles are very memory-heavy
*
- * @param array $titles An array of strings, or Title objects
- * @param User $user
+ * @param $titles An array of strings, or Title objects
+ * @param $user User
*/
private function unwatchTitles( $titles, $user ) {
$dbw = wfGetDB( DB_MASTER );
$dbw->delete(
'watchlist',
array(
- 'wl_user' => $user->getID(),
+ 'wl_user' => $user->getId(),
'wl_namespace' => ( $title->getNamespace() & ~1 ),
'wl_title' => $title->getDBkey(),
),
$dbw->delete(
'watchlist',
array(
- 'wl_user' => $user->getID(),
+ 'wl_user' => $user->getId(),
'wl_namespace' => ( $title->getNamespace() | 1 ),
'wl_title' => $title->getDBkey(),
),
/**
* Show the standard watchlist editing form
*
- * @param OutputPage $output
- * @param User $user
+ * @param $output OutputPage
+ * @param $user User
*/
private function showNormalForm( $output, $user ) {
global $wgUser;
/**
* Get the correct "heading" for a namespace
*
- * @param int $namespace
+ * @param $namespace int
* @return string
*/
private function getNamespaceHeading( $namespace ) {
* Build a single list item containing a check box selecting a title
* and a link to that title, with various additional bits
*
- * @param Title $title
- * @param bool $redirect
- * @param Skin $skin
+ * @param $title Title
+ * @param $redirect bool
+ * @param $skin Skin
* @return string
*/
private function buildRemoveLine( $title, $redirect, $skin ) {
/**
* Show a form for editing the watchlist in "raw" mode
*
- * @param OutputPage $output
- * @param User $user
+ * @param $output OutputPage
+ * @param $user User
*/
public function showRawForm( $output, $user ) {
global $wgUser;
* Determine whether we are editing the watchlist, and if so, what
* kind of editing operation
*
- * @param WebRequest $request
- * @param mixed $par
+ * @param $request WebRequest
+ * @param $par mixed
* @return int
*/
public static function getMode( $request, $par ) {
* Build a set of links for convenient navigation
* between watchlist viewing and editing modes
*
- * @param Skin $skin Skin to use
+ * @param $skin Skin to use
* @return string
*/
public static function buildTools( $skin ) {