Convert all array() syntax to []
[lhc/web/wiklou.git] / includes / api / ApiFeedWatchlist.php
index c841d83..af5b1af 100644 (file)
@@ -67,7 +67,7 @@ class ApiFeedWatchlist extends ApiBase {
                        $endTime = wfTimestamp( TS_MW, time() - intval( $params['hours'] * 60 * 60 ) );
 
                        // Prepare parameters for nested request
-                       $fauxReqArr = array(
+                       $fauxReqArr = [
                                'action' => 'query',
                                'meta' => 'siteinfo',
                                'siprop' => 'general',
@@ -76,7 +76,7 @@ class ApiFeedWatchlist extends ApiBase {
                                'wldir' => 'older', // reverse order - from newest to oldest
                                'wlend' => $endTime, // stop at this time
                                'wllimit' => min( 50, $this->getConfig()->get( 'FeedLimit' ) )
-                       );
+                       ];
 
                        if ( $params['wlowner'] !== null ) {
                                $fauxReqArr['wlowner'] = $params['wlowner'];
@@ -112,8 +112,8 @@ class ApiFeedWatchlist extends ApiBase {
                        $module = new ApiMain( $fauxReq );
                        $module->execute();
 
-                       $data = $module->getResult()->getResultData( array( 'query', 'watchlist' ) );
-                       $feedItems = array();
+                       $data = $module->getResult()->getResultData( [ 'query', 'watchlist' ] );
+                       $feedItems = [];
                        foreach ( (array)$data as $key => $info ) {
                                if ( ApiResult::isMetadataKey( $key ) ) {
                                        continue;
@@ -176,20 +176,20 @@ class ApiFeedWatchlist extends ApiBase {
 
                $titleStr = $info['title'];
                $title = Title::newFromText( $titleStr );
-               $curidParam = array();
+               $curidParam = [];
                if ( !$title || $title->isExternal() ) {
                        // Probably a formerly-valid title that's now conflicting with an
                        // interwiki prefix or the like.
                        if ( isset( $info['pageid'] ) ) {
                                $title = Title::newFromID( $info['pageid'] );
-                               $curidParam = array( 'curid' => $info['pageid'] );
+                               $curidParam = [ 'curid' => $info['pageid'] ];
                        }
                        if ( !$title || $title->isExternal() ) {
                                return null;
                        }
                }
                if ( isset( $info['revid'] ) ) {
-                       $titleUrl = $title->getFullURL( array( 'diff' => $info['revid'] ) );
+                       $titleUrl = $title->getFullURL( [ 'diff' => $info['revid'] ] );
                } else {
                        $titleUrl = $title->getFullURL( $curidParam );
                }
@@ -233,34 +233,34 @@ class ApiFeedWatchlist extends ApiBase {
 
        public function getAllowedParams( $flags = 0 ) {
                $feedFormatNames = array_keys( $this->getConfig()->get( 'FeedClasses' ) );
-               $ret = array(
-                       'feedformat' => array(
+               $ret = [
+                       'feedformat' => [
                                ApiBase::PARAM_DFLT => 'rss',
                                ApiBase::PARAM_TYPE => $feedFormatNames
-                       ),
-                       'hours' => array(
+                       ],
+                       'hours' => [
                                ApiBase::PARAM_DFLT => 24,
                                ApiBase::PARAM_TYPE => 'integer',
                                ApiBase::PARAM_MIN => 1,
                                ApiBase::PARAM_MAX => 72,
-                       ),
+                       ],
                        'linktosections' => false,
-               );
+               ];
 
-               $copyParams = array(
+               $copyParams = [
                        'allrev' => 'allrev',
                        'owner' => 'wlowner',
                        'token' => 'wltoken',
                        'show' => 'wlshow',
                        'type' => 'wltype',
                        'excludeuser' => 'wlexcludeuser',
-               );
+               ];
                if ( $flags ) {
                        $wlparams = $this->getWatchlistModule()->getAllowedParams( $flags );
                        foreach ( $copyParams as $from => $to ) {
                                $p = $wlparams[$from];
                                if ( !is_array( $p ) ) {
-                                       $p = array( ApiBase::PARAM_DFLT => $p );
+                                       $p = [ ApiBase::PARAM_DFLT => $p ];
                                }
                                if ( !isset( $p[ApiBase::PARAM_HELP_MSG] ) ) {
                                        $p[ApiBase::PARAM_HELP_MSG] = "apihelp-query+watchlist-param-$from";
@@ -286,12 +286,12 @@ class ApiFeedWatchlist extends ApiBase {
        }
 
        protected function getExamplesMessages() {
-               return array(
+               return [
                        'action=feedwatchlist'
                                => 'apihelp-feedwatchlist-example-default',
                        'action=feedwatchlist&allrev=&hours=6'
                                => 'apihelp-feedwatchlist-example-all6hrs',
-               );
+               ];
        }
 
        public function getHelpUrls() {