X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiWatch.php;h=f09fdcb063c9cc927482729afacd013e44e04a83;hb=c340c41b37b5079ba90489f6b212bb8e4642031a;hp=9eb5f2a4ec4e3730c127311909b48ff6ac40542d;hpb=ca5c234d189fbbf348e3e5a74d0070ac4ee1db4b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiWatch.php b/includes/api/ApiWatch.php index 9eb5f2a4ec..f09fdcb063 100644 --- a/includes/api/ApiWatch.php +++ b/includes/api/ApiWatch.php @@ -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() {