Merge "Make unused variable optional in ChangesList::insertDiffHist"
[lhc/web/wiklou.git] / includes / api / ApiWatch.php
index 9eb5f2a..f09fdcb 100644 (file)
@@ -44,7 +44,7 @@ class ApiWatch extends ApiBase {
 
                $params = $this->extractRequestParams();
 
-               $continuationManager = new ApiContinuationManager( $this, array(), array() );
+               $continuationManager = new ApiContinuationManager( $this, [], [] );
                $this->setContinuationManager( $continuationManager );
 
                $pageSet = $this->getPageSet();
@@ -52,13 +52,13 @@ class ApiWatch extends ApiBase {
                // title is still supported for backward compatibility
                if ( !isset( $params['title'] ) ) {
                        $pageSet->execute();
-                       $res = $pageSet->getInvalidTitlesAndRevisions( array(
+                       $res = $pageSet->getInvalidTitlesAndRevisions( [
                                'invalidTitles',
                                'special',
                                'missingIds',
                                'missingRevIds',
                                'interwikiTitles'
-                       ) );
+                       ] );
 
                        foreach ( $pageSet->getMissingTitles() as $title ) {
                                $r = $this->watchTitle( $title, $user, $params );
@@ -80,14 +80,14 @@ class ApiWatch extends ApiBase {
                        if ( $extraParams ) {
                                $p = $this->getModulePrefix();
                                $this->dieUsage(
-                                       "The parameter {$p}title can not be used with " . implode( ", ", $extraParams ),
+                                       "The parameter {$p}title can not be used with " . implode( ', ', $extraParams ),
                                        'invalidparammix'
                                );
                        }
 
                        $title = Title::newFromText( $params['title'] );
                        if ( !$title || !$title->isWatchable() ) {
-                               $this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
+                               $this->dieUsageMsg( [ 'invalidtitle', $params['title'] ] );
                        }
                        $res = $this->watchTitle( $title, $user, $params, true );
                }
@@ -101,10 +101,10 @@ class ApiWatch extends ApiBase {
                $compatibilityMode = false
        ) {
                if ( !$title->isWatchable() ) {
-                       return array( 'title' => $title->getPrefixedText(), 'watchable' => 0 );
+                       return [ 'title' => $title->getPrefixedText(), 'watchable' => 0 ];
                }
 
-               $res = array( 'title' => $title->getPrefixedText() );
+               $res = [ 'title' => $title->getPrefixedText() ];
 
                if ( $params['unwatch'] ) {
                        $status = UnwatchAction::doUnwatch( $title, $user );
@@ -157,16 +157,16 @@ class ApiWatch extends ApiBase {
        }
 
        public function getAllowedParams( $flags = 0 ) {
-               $result = array(
-                       'title' => array(
+               $result = [
+                       'title' => [
                                ApiBase::PARAM_TYPE => 'string',
                                ApiBase::PARAM_DEPRECATED => true
-                       ),
+                       ],
                        'unwatch' => false,
-                       'continue' => array(
+                       'continue' => [
                                ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
-                       ),
-               );
+                       ],
+               ];
                if ( $flags ) {
                        $result += $this->getPageSet()->getFinalParams( $flags );
                }
@@ -175,14 +175,14 @@ class ApiWatch extends ApiBase {
        }
 
        protected function getExamplesMessages() {
-               return array(
+               return [
                        'action=watch&titles=Main_Page&token=123ABC'
                                => 'apihelp-watch-example-watch',
                        'action=watch&titles=Main_Page&unwatch=&token=123ABC'
                                => 'apihelp-watch-example-unwatch',
                        'action=watch&generator=allpages&gapnamespace=0&token=123ABC'
                                => 'apihelp-watch-example-generator',
-               );
+               ];
        }
 
        public function getHelpUrls() {