Followup r82727, improve comments, cast return value to bool
This commit is contained in:
parent
ab408b911d
commit
28f7bf1f2b
2 changed files with 5 additions and 2 deletions
|
|
@ -2431,6 +2431,9 @@ class Article {
|
|||
|
||||
/**
|
||||
* Add this page to $wgUser's watchlist
|
||||
*
|
||||
* This is safe to be called multiple times
|
||||
*
|
||||
* @return bool true on successful watch operation
|
||||
*/
|
||||
public function doWatch() {
|
||||
|
|
|
|||
|
|
@ -602,8 +602,8 @@ abstract class ApiBase {
|
|||
$userOption = $titleObj->exists()
|
||||
? 'watchdefault' : 'watchcreations';
|
||||
}
|
||||
# If the corresponding user option is true, watch, don't
|
||||
return $wgUser->getOption( $userOption ) ? true : false;
|
||||
# Watch the article based on the user preference
|
||||
return (bool)$wgUser->getOption( $userOption );
|
||||
|
||||
case 'nochange':
|
||||
return $userWatching;
|
||||
|
|
|
|||
Loading…
Reference in a new issue