aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiTokens.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiTokens.php')
-rw-r--r--includes/api/ApiTokens.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/api/ApiTokens.php b/includes/api/ApiTokens.php
index 4940394fe824..fc2951a9db8b 100644
--- a/includes/api/ApiTokens.php
+++ b/includes/api/ApiTokens.php
@@ -31,10 +31,10 @@
class ApiTokens extends ApiBase {
public function execute() {
- $this->setWarning(
- 'action=tokens has been deprecated. Please use action=query&meta=tokens instead.'
+ $this->addDeprecation(
+ [ 'apiwarn-deprecation-withreplacement', 'action=tokens', 'action=query&meta=tokens' ],
+ 'action=tokens'
);
- $this->logFeatureUsage( 'action=tokens' );
$params = $this->extractRequestParams();
$res = [
@@ -46,7 +46,7 @@ class ApiTokens extends ApiBase {
$val = call_user_func( $types[$type], null, null );
if ( $val === false ) {
- $this->setWarning( "Action '$type' is not allowed for the current user" );
+ $this->addWarning( [ 'apiwarn-tokennotallowed', $type ] );
} else {
$res[$type . 'token'] = $val;
}