Remove pre-1.25 API compatibility code

Since this extension uses extension.json, it already requires 1.25+ so
no need to keep the old code around.

Change-Id: I6f968be3b7ef7cbc7193c8e103beb36ecf9c7b60
This commit is contained in:
Brad Jorsch 2016-09-20 14:39:11 -04:00
parent ebd398b4d6
commit 3aa76b0f5f
6 changed files with 5 additions and 199 deletions

View file

@ -55,11 +55,9 @@ class ApiAbuseFilterCheckMatch extends ApiBase {
}
$result = array(
ApiResult::META_BC_BOOLS => 'result',
'result' => AbuseFilter::checkConditions( $params['filter'], $vars ),
);
if ( defined( 'ApiResult::META_CONTENT' ) ) {
$result[ApiResult::META_BC_BOOLS][] = 'result';
}
$this->getResult()->addValue(
null,
@ -83,35 +81,6 @@ class ApiAbuseFilterCheckMatch extends ApiBase {
);
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getParamDescription() {
return array(
'filter' => 'The full filter text to check for a match',
'vars' => 'JSON encoded array of variables to test against',
'rcid' => 'Recent change ID to check against',
'logid' => 'Abuse filter log ID to check against',
);
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getDescription() {
return array(
'Check to see if an AbuseFilter matches a set of variables, edit'
. 'or logged AbuseFilter event.',
'vars, rcid or logid is required however only one may be used',
);
}
public function getExamples() {
return array(
'api.php?action=abusefiltercheckmatch&filter=!("autoconfirmed"%20in%20user_groups)&rcid=15'
);
}
/**
* @see ApiBase::getExamplesMessages()
*/

View file

@ -37,34 +37,6 @@ class ApiAbuseFilterCheckSyntax extends ApiBase {
);
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getParamDescription() {
return array(
'filter' => 'The full filter text to check syntax on',
);
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getDescription() {
return array(
'Check syntax of an AbuseFilter filter'
);
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getExamples() {
return array(
'api.php?action=abusefilterchecksyntax&filter="foo"',
'api.php?action=abusefilterchecksyntax&filter="bar"%20bad_variable',
);
}
/**
* @see ApiBase::getExamplesMessages()
*/

View file

@ -17,33 +17,6 @@ class ApiAbuseFilterEvalExpression extends ApiBase {
);
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getParamDescription() {
return array(
'expression' => 'The expression to evaluate',
);
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getDescription() {
return array(
'Evaluates an AbuseFilter expression'
);
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getExamples() {
return array(
'api.php?action=abusefilterevalexpression&expression=lcase("FOO")'
);
}
/**
* @see ApiBase::getExamplesMessages()
*/

View file

@ -46,40 +46,10 @@ class ApiAbuseFilterUnblockAutopromote extends ApiBase {
);
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getParamDescription() {
return array(
'user' => 'Username of the user you want to unblock',
'token' => 'An edit token',
);
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getDescription() {
return 'Unblocks a user from receiving autopromotions due to an abusefilter consequence';
}
public function needsToken() {
return 'csrf';
}
public function getTokenSalt() {
return '';
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getExamples() {
return array(
"api.php?action=abusefilterunblockautopromote&user=Bob&token=%2B\\"
);
}
/**
* @see ApiBase::getExamplesMessages()
*/

View file

@ -151,11 +151,7 @@ class ApiQueryAbuseFilters extends ApiQueryBase {
}
}
}
if ( defined( 'ApiResult::META_CONTENT' ) ) {
$result->addIndexedTagName( array( 'query', $this->getModuleName() ), 'filter' );
} else {
$result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'filter' );
}
$result->addIndexedTagName( array( 'query', $this->getModuleName() ), 'filter' );
}
public function getAllowedParams() {
@ -172,10 +168,7 @@ class ApiQueryAbuseFilters extends ApiQueryBase {
'newer'
),
ApiBase::PARAM_DFLT => 'newer',
/** @todo Once support for MediaWiki < 1.25 is dropped,
* just use ApiBase::PARAM_HELP_MSG directly
*/
constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '' => 'api-help-param-direction',
ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
),
'show' => array(
ApiBase::PARAM_ISMULTI => true,
@ -214,37 +207,6 @@ class ApiQueryAbuseFilters extends ApiQueryBase {
);
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getParamDescription() {
return array(
'startid' => 'The filter id to start enumerating from',
'endid' => 'The filter id to stop enumerating at',
'dir' => 'The direction in which to enumerate',
'show' => 'Show only filters which meet these criteria',
'limit' => 'The maximum number of filters to list',
'prop' => 'Which properties to get',
);
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getDescription() {
return 'Show details of the abuse filters.';
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getExamples() {
return array(
'api.php?action=query&list=abusefilters&abfshow=enabled|!private',
'api.php?action=query&list=abusefilters&abfprop=id|description|pattern'
);
}
/**
* @see ApiBase::getExamplesMessages()
*/

View file

@ -232,11 +232,7 @@ class ApiQueryAbuseLog extends ApiQueryBase {
}
}
}
if ( defined( 'ApiResult::META_CONTENT' ) ) {
$result->addIndexedTagName( array( 'query', $this->getModuleName() ), 'item' );
} else {
$result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'item' );
}
$result->addIndexedTagName( array( 'query', $this->getModuleName() ), 'item' );
}
public function getAllowedParams() {
@ -253,10 +249,7 @@ class ApiQueryAbuseLog extends ApiQueryBase {
'older'
),
ApiBase::PARAM_DFLT => 'older',
/** @todo Once support for MediaWiki < 1.25 is dropped,
* just use ApiBase::PARAM_HELP_MSG directly
*/
constant( 'ApiBase::PARAM_HELP_MSG' ) ?: '' => 'api-help-param-direction',
ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
),
'user' => null,
'title' => null,
@ -290,39 +283,6 @@ class ApiQueryAbuseLog extends ApiQueryBase {
);
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getParamDescription() {
return array(
'start' => 'The timestamp to start enumerating from',
'end' => 'The timestamp to stop enumerating at',
'dir' => 'The direction in which to enumerate',
'title' => 'Show only entries occurring on a given page.',
'user' => 'Show only entries done by a given user or IP address.',
'filter' => 'Show only entries that were caught by a given filter ID',
'limit' => 'The maximum amount of entries to list',
'prop' => 'Which properties to get',
);
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getDescription() {
return 'Show events that were caught by one of the abuse filters.';
}
/**
* @deprecated since MediaWiki core 1.25
*/
public function getExamples() {
return array(
'api.php?action=query&list=abuselog',
'api.php?action=query&list=abuselog&afltitle=API'
);
}
/**
* @see ApiBase::getExamplesMessages()
*/