X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fjobqueue%2Fjobs%2FActivityUpdateJob.php;h=f146e6e8bc7bf4a088f327bebdcb08d62e498592;hb=12601ff7d2796752404bfb331fccc41083d31f9f;hp=495bda995bd634202a44a33ffaaebceeb577cf1e;hpb=04af4fb8e7fcacd0e8556afffa6e5c4e3b3c6792;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/jobqueue/jobs/ActivityUpdateJob.php b/includes/jobqueue/jobs/ActivityUpdateJob.php index 495bda995b..da4ec2336d 100644 --- a/includes/jobqueue/jobs/ActivityUpdateJob.php +++ b/includes/jobqueue/jobs/ActivityUpdateJob.php @@ -16,7 +16,6 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @author Aaron Schulz * @ingroup JobQueue */ @@ -27,7 +26,7 @@ * @since 1.26 */ class ActivityUpdateJob extends Job { - function __construct( $title, $params ) { + function __construct( Title $title, array $params ) { parent::__construct( 'activityUpdateJob', $title, $params ); if ( !isset( $params['type'] ) ) { @@ -41,7 +40,8 @@ class ActivityUpdateJob extends Job { if ( $this->params['type'] === 'updateWatchlistNotification' ) { $this->updateWatchlistNotification(); } else { - throw new Exception( "Invalid 'type' parameter '{$this->params['type']}'." ); + throw new InvalidArgumentException( + "Invalid 'type' parameter '{$this->params['type']}'." ); } return true; @@ -54,10 +54,10 @@ class ActivityUpdateJob extends Job { $dbw = wfGetDB( DB_MASTER ); $dbw->update( 'watchlist', - array( + [ 'wl_notificationtimestamp' => $dbw->timestampOrNull( $this->params['notifTime'] ) - ), - array( + ], + [ 'wl_user' => $this->params['userid'], 'wl_namespace' => $this->title->getNamespace(), 'wl_title' => $this->title->getDBkey(), @@ -68,7 +68,7 @@ class ActivityUpdateJob extends Job { // is non-NULL, make sure not to set it back in time or set it to // NULL when newer revisions were in fact added to the page. 'wl_notificationtimestamp < ' . $dbw->addQuotes( $dbw->timestamp( $casTimestamp ) ) - ), + ], __METHOD__ ); }