X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiBlock.php;h=e4c9d0a80b171225cd8bf2fad6f7f458f62b040a;hb=915209fe6bac3176ae380409ca27b478e3d36478;hp=636baa7fefa57a91dc08b7dddd4479899943e7ec;hpb=ea9fcc1e4d3b572199d82c426024e3e5efe23879;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php index 636baa7fef..e4c9d0a80b 100644 --- a/includes/api/ApiBlock.php +++ b/includes/api/ApiBlock.php @@ -57,7 +57,7 @@ class ApiBlock extends ApiBase { $msg['info'], $msg['code'], 0, - array( 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $user->getBlock() ) ) + [ 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $user->getBlock() ) ] ); } } @@ -68,7 +68,7 @@ class ApiBlock extends ApiBase { 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' ) ) { @@ -78,14 +78,14 @@ class ApiBlock extends ApiBase { $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'], @@ -96,7 +96,7 @@ class ApiBlock extends ApiBase { 'Reblock' => $params['reblock'], 'Watch' => $params['watchuser'], 'Confirm' => true, - ); + ]; $retval = SpecialBlock::processForm( $data, $this->getContext() ); if ( $retval !== true ) { @@ -139,11 +139,11 @@ class ApiBlock extends ApiBase { } 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, @@ -154,7 +154,7 @@ class ApiBlock extends ApiBase { 'allowusertalk' => false, 'reblock' => false, 'watchuser' => false, - ); + ]; } public function needsToken() { @@ -163,12 +163,12 @@ class ApiBlock extends ApiBase { protected function getExamplesMessages() { // @codingStandardsIgnoreStart Generic.Files.LineLength - return array( + 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 }