Merge "Rename PoolCounter_Stub to PoolCounterNull"
[lhc/web/wiklou.git] / includes / api / ApiSetNotificationTimestamp.php
index 41c207b..ba4c6e8 100644 (file)
@@ -108,14 +108,7 @@ class ApiSetNotificationTimestamp extends ApiBase {
                $result = [];
                if ( $params['entirewatchlist'] ) {
                        // Entire watchlist mode: Just update the thing and return a success indicator
-                       if ( is_null( $timestamp ) ) {
-                               $watchedItemStore->resetAllNotificationTimestampsForUser( $user );
-                       } else {
-                               $watchedItemStore->setNotificationTimestampsForUser(
-                                       $user,
-                                       $timestamp
-                               );
-                       }
+                       $watchedItemStore->resetAllNotificationTimestampsForUser( $user, $timestamp );
 
                        $result['notificationtimestamp'] = is_null( $timestamp )
                                ? ''
@@ -161,7 +154,7 @@ class ApiSetNotificationTimestamp extends ApiBase {
                                        $ns = $title->getNamespace();
                                        $dbkey = $title->getDBkey();
                                        $r = [
-                                               'ns' => intval( $ns ),
+                                               'ns' => (int)$ns,
                                                'title' => $title->getPrefixedText(),
                                        ];
                                        if ( !$title->exists() ) {