Removed 'Remember my login' preference
[lhc/web/wiklou.git] / includes / api / ApiWatch.php
index 09f9356..6dfb1b4 100644 (file)
@@ -48,12 +48,20 @@ class ApiWatch extends ApiBase {
                // title is still supported for backward compatibility
                if ( !isset( $params['title'] ) ) {
                        $pageSet->execute();
-                       $res = $pageSet->getInvalidTitlesAndRevisions( array( 'invalidTitles', 'special', 'missingIds', 'missingRevIds', 'interwikiTitles' ) );
+                       $res = $pageSet->getInvalidTitlesAndRevisions( array(
+                               'invalidTitles',
+                               'special',
+                               'missingIds',
+                               'missingRevIds',
+                               'interwikiTitles'
+                       ) );
+
                        foreach ( $pageSet->getMissingTitles() as $title ) {
                                $r = $this->watchTitle( $title, $user, $params );
                                $r['missing'] = 1;
                                $res[] = $r;
                        }
+
                        foreach ( $pageSet->getGoodTitles() as $title ) {
                                $r = $this->watchTitle( $title, $user, $params );
                                $res[] = $r;
@@ -64,9 +72,13 @@ class ApiWatch extends ApiBase {
                        $extraParams = array_keys( array_filter( $pageSet->extractRequestParams(), function ( $x ) {
                                return $x !== null && $x !== false;
                        } ) );
+
                        if ( $extraParams ) {
                                $p = $this->getModulePrefix();
-                               $this->dieUsage( "The parameter {$p}title can not be used with ".  implode( ", ", $extraParams ), 'invalidparammix' );
+                               $this->dieUsage(
+                                       "The parameter {$p}title can not be used with " . implode( ", ", $extraParams ),
+                                       'invalidparammix'
+                               );
                        }
 
                        $title = Title::newFromText( $params['title'] );
@@ -78,7 +90,9 @@ class ApiWatch extends ApiBase {
                $this->getResult()->addValue( null, $this->getModuleName(), $res );
        }
 
-       private function watchTitle( Title $title, User $user, array $params, $compatibilityMode = false ) {
+       private function watchTitle( Title $title, User $user, array $params,
+               $compatibilityMode = false
+       ) {
                if ( !$title->isWatchable() ) {
                        return array( 'title' => $title->getPrefixedText(), 'watchable' => 0 );
                }
@@ -116,17 +130,16 @@ class ApiWatch extends ApiBase {
                        $this->getContext()->setLanguage( $oldLang ); // Reset language to $oldLang
                }
 
-
                if ( !$status->isOK() ) {
                        if ( $compatibilityMode ) {
                                $this->dieStatus( $status );
                        }
-                       $res['error'] =  $this->getErrorFromStatus( $status );
+                       $res['error'] = $this->getErrorFromStatus( $status );
                }
+
                return $res;
        }
 
-
        /**
         * Get a cached instance of an ApiPageSet object
         * @return ApiPageSet
@@ -135,6 +148,7 @@ class ApiWatch extends ApiBase {
                if ( $this->mPageSet === null ) {
                        $this->mPageSet = new ApiPageSet( $this );
                }
+
                return $this->mPageSet;
        }
 
@@ -170,11 +184,13 @@ class ApiWatch extends ApiBase {
                if ( $flags ) {
                        $result += $this->getPageSet()->getFinalParams( $flags );
                }
+
                return $result;
        }
 
        public function getParamDescription() {
                $psModule = $this->getPageSet();
+
                return $psModule->getParamDescription() + array(
                        'title' => 'The page to (un)watch. use titles instead',
                        'unwatch' => 'If set the page will be unwatched rather than watched',
@@ -195,7 +211,7 @@ class ApiWatch extends ApiBase {
        }
 
        public function getDescription() {
-               return 'Add or remove pages from/to the current user\'s watchlist';
+               return 'Add or remove pages from/to the current user\'s watchlist.';
        }
 
        public function getPossibleErrors() {