);
if ( $status->isGood() ) {
- $result = array( 'result' => 'Success' );
+ $result = [ 'result' => 'Success' ];
} else {
- $result = array(
+ $result = [
'result' => 'Failure',
'errors' => $this->getErrorFormatter()->arrayFromStatus( $status ),
- );
+ ];
}
$this->getResult()->addValue( null, $this->getModuleName(), $result );
// Validate the input title
$title = Title::makeTitleSafe( NS_FILE, $this->params['filename'] );
if ( is_null( $title ) ) {
- $this->dieUsageMsg( array( 'invalidtitle', $this->params['filename'] ) );
+ $this->dieUsageMsg( [ 'invalidtitle', $this->params['filename'] ] );
}
$localRepo = RepoGroup::singleton()->getLocalRepo();
}
public function getAllowedParams() {
- return array(
- 'filename' => array(
+ return [
+ 'filename' => [
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true,
- ),
- 'comment' => array(
+ ],
+ 'comment' => [
ApiBase::PARAM_DFLT => '',
- ),
- 'archivename' => array(
+ ],
+ 'archivename' => [
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true,
- ),
- );
+ ],
+ ];
}
public function needsToken() {
}
protected function getExamplesMessages() {
- return array(
+ return [
'action=filerevert&filename=Wiki.png&comment=Revert&' .
'archivename=20110305152740!Wiki.png&token=123ABC'
=> 'apihelp-filerevert-example-revert',
- );
+ ];
}
}