$msg['info'],
$msg['code'],
0,
- array( 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $user->getBlock() ) )
+ [ 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $user->getBlock() ) ]
);
}
}
if ( $target instanceof User &&
( $target->isAnon() /* doesn't exist */ || !User::isUsableName( $target->getName() ) )
) {
- $this->dieUsageMsg( array( 'nosuchuser', $params['user'] ) );
+ $this->dieUsageMsg( [ 'nosuchuser', $params['user'] ] );
}
if ( $params['hidename'] && !$user->isAllowed( 'hideuser' ) ) {
$this->dieUsageMsg( 'cantblock-email' );
}
- $data = array(
+ $data = [
'PreviousTarget' => $params['user'],
'Target' => $params['user'],
- 'Reason' => array(
+ 'Reason' => [
$params['reason'],
'other',
$params['reason']
- ),
+ ],
'Expiry' => $params['expiry'],
'HardBlock' => !$params['anononly'],
'CreateAccount' => $params['nocreate'],
'Reblock' => $params['reblock'],
'Watch' => $params['watchuser'],
'Confirm' => true,
- );
+ ];
$retval = SpecialBlock::processForm( $data, $this->getContext() );
if ( $retval !== true ) {
}
public function getAllowedParams() {
- return array(
- 'user' => array(
- ApiBase::PARAM_TYPE => 'string',
+ return [
+ 'user' => [
+ ApiBase::PARAM_TYPE => 'user',
ApiBase::PARAM_REQUIRED => true
- ),
+ ],
'expiry' => 'never',
'reason' => '',
'anononly' => false,
'allowusertalk' => false,
'reblock' => false,
'watchuser' => false,
- );
+ ];
}
public function needsToken() {
}
protected function getExamplesMessages() {
- return array(
+ // @codingStandardsIgnoreStart Generic.Files.LineLength
+ return [
'action=block&user=192.0.2.5&expiry=3%20days&reason=First%20strike&token=123ABC'
=> 'apihelp-block-example-ip-simple',
'action=block&user=Vandal&expiry=never&reason=Vandalism&nocreate=&autoblock=&noemail=&token=123ABC'
=> 'apihelp-block-example-user-complex',
- );
+ ];
+ // @codingStandardsIgnoreEnd
}
public function getHelpUrls() {