ChangeTags::addTags( $params['tags'], null, null, $status->value, null );
}
- $r = array(
+ $r = [
'title' => $titleObj->getPrefixedText(),
'reason' => $reason,
'logid' => $status->value
- );
+ ];
$this->getResult()->addValue( null, $this->getModuleName(), $r );
}
$hasHistory = false;
$reason = $page->getAutoDeleteReason( $hasHistory );
if ( $reason === false ) {
- return array( array( 'cannotdelete', $title->getPrefixedText() ) );
+ return [ [ 'cannotdelete', $title->getPrefixedText() ] ];
}
}
if ( $oldimage ) {
if ( !FileDeleteForm::isValidOldSpec( $oldimage ) ) {
- return array( array( 'invalidoldimage' ) );
+ return [ [ 'invalidoldimage' ] ];
}
$oldfile = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $title, $oldimage );
if ( !$oldfile->exists() || !$oldfile->isLocal() || $oldfile->getRedirected() ) {
- return array( array( 'nodeleteablefile' ) );
+ return [ [ 'nodeleteablefile' ] ];
}
}
}
public function getAllowedParams() {
- return array(
+ return [
'title' => null,
- 'pageid' => array(
+ 'pageid' => [
ApiBase::PARAM_TYPE => 'integer'
- ),
+ ],
'reason' => null,
- 'tags' => array(
- ApiBase::PARAM_TYPE => ChangeTags::listExplicitlyDefinedTags(),
+ 'tags' => [
+ ApiBase::PARAM_TYPE => 'tags',
ApiBase::PARAM_ISMULTI => true,
- ),
- 'watch' => array(
+ ],
+ 'watch' => [
ApiBase::PARAM_DFLT => false,
ApiBase::PARAM_DEPRECATED => true,
- ),
- 'watchlist' => array(
+ ],
+ 'watchlist' => [
ApiBase::PARAM_DFLT => 'preferences',
- ApiBase::PARAM_TYPE => array(
+ ApiBase::PARAM_TYPE => [
'watch',
'unwatch',
'preferences',
'nochange'
- ),
- ),
- 'unwatch' => array(
+ ],
+ ],
+ 'unwatch' => [
ApiBase::PARAM_DFLT => false,
ApiBase::PARAM_DEPRECATED => true,
- ),
+ ],
'oldimage' => null,
- );
+ ];
}
public function needsToken() {
}
protected function getExamplesMessages() {
- return array(
+ return [
'action=delete&title=Main%20Page&token=123ABC'
=> 'apihelp-delete-example-simple',
'action=delete&title=Main%20Page&token=123ABC&reason=Preparing%20for%20move'
=> 'apihelp-delete-example-reason',
- );
+ ];
}
public function getHelpUrls() {