X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiMergeHistory.php;h=276f1c0ebeee7760a959249961f7e43da8ba2adc;hb=f8a58fa67efade327656d6c62abfd8ea7b32a7cd;hp=8fa9d28ebf73f7f0788b734a4a57c33c238a1adf;hpb=a09d9d61db4b1ad3c63c3aeffd62b2298ed678b7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiMergeHistory.php b/includes/api/ApiMergeHistory.php index 8fa9d28ebf..276f1c0ebe 100644 --- a/includes/api/ApiMergeHistory.php +++ b/includes/api/ApiMergeHistory.php @@ -33,7 +33,6 @@ class ApiMergeHistory extends ApiBase { public function execute() { $this->useTransactionalTimeLimit(); - $user = $this->getUser(); $params = $this->extractRequestParams(); $this->requireOnlyOneParameter( $params, 'from', 'fromid' ); @@ -43,24 +42,24 @@ class ApiMergeHistory extends ApiBase { if ( isset( $params['from'] ) ) { $fromTitle = Title::newFromText( $params['from'] ); if ( !$fromTitle || $fromTitle->isExternal() ) { - $this->dieUsageMsg( array( 'invalidtitle', $params['from'] ) ); + $this->dieUsageMsg( [ 'invalidtitle', $params['from'] ] ); } } elseif ( isset( $params['fromid'] ) ) { $fromTitle = Title::newFromID( $params['fromid'] ); if ( !$fromTitle ) { - $this->dieUsageMsg( array( 'nosuchpageid', $params['fromid'] ) ); + $this->dieUsageMsg( [ 'nosuchpageid', $params['fromid'] ] ); } } if ( isset( $params['to'] ) ) { $toTitle = Title::newFromText( $params['to'] ); if ( !$toTitle || $toTitle->isExternal() ) { - $this->dieUsageMsg( array( 'invalidtitle', $params['to'] ) ); + $this->dieUsageMsg( [ 'invalidtitle', $params['to'] ] ); } } elseif ( isset( $params['toid'] ) ) { $toTitle = Title::newFromID( $params['toid'] ); if ( !$toTitle ) { - $this->dieUsageMsg( array( 'nosuchpageid', $params['toid'] ) ); + $this->dieUsageMsg( [ 'nosuchpageid', $params['toid'] ] ); } } @@ -73,12 +72,12 @@ class ApiMergeHistory extends ApiBase { $this->dieStatus( $status ); } - $r = array( + $r = [ 'from' => $fromTitle->getPrefixedText(), 'to' => $toTitle->getPrefixedText(), 'timestamp' => wfTimestamp( TS_ISO_8601, $params['timestamp'] ), 'reason' => $params['reason'] - ); + ]; $result = $this->getResult(); $result->addValue( null, $this->getModuleName(), $r ); @@ -106,20 +105,20 @@ class ApiMergeHistory extends ApiBase { } public function getAllowedParams() { - return array( + return [ 'from' => null, - 'fromid' => array( + 'fromid' => [ ApiBase::PARAM_TYPE => 'integer' - ), + ], 'to' => null, - 'toid' => array( + 'toid' => [ ApiBase::PARAM_TYPE => 'integer' - ), - 'timestamp' => array( + ], + 'timestamp' => [ ApiBase::PARAM_TYPE => 'timestamp' - ), + ], 'reason' => '', - ); + ]; } public function needsToken() { @@ -127,14 +126,14 @@ class ApiMergeHistory extends ApiBase { } protected function getExamplesMessages() { - return array( + return [ 'action=mergehistory&from=Oldpage&to=Newpage&token=123ABC&' . 'reason=Reason' => 'apihelp-mergehistory-example-merge', 'action=mergehistory&from=Oldpage&to=Newpage&token=123ABC&' . 'reason=Reason×tamp=2015-12-31T04%3A37%3A41Z' // TODO => 'apihelp-mergehistory-example-merge-timestamp', - ); + ]; } public function getHelpUrls() {