Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311772

Change subject: Remove pre-1.25 API compatibility code
......................................................................

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
---
M api/ApiAbuseFilterCheckMatch.php
M api/ApiAbuseFilterCheckSyntax.php
M api/ApiAbuseFilterEvalExpression.php
M api/ApiAbuseFilterUnblockAutopromote.php
M api/ApiQueryAbuseFilters.php
M api/ApiQueryAbuseLog.php
6 files changed, 5 insertions(+), 199 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter 
refs/changes/72/311772/1

diff --git a/api/ApiAbuseFilterCheckMatch.php b/api/ApiAbuseFilterCheckMatch.php
index f426eec..d20e80d 100644
--- a/api/ApiAbuseFilterCheckMatch.php
+++ b/api/ApiAbuseFilterCheckMatch.php
@@ -55,11 +55,9 @@
                }
 
                $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,
@@ -80,35 +78,6 @@
                        'logid' => array(
                                ApiBase::PARAM_TYPE => 'integer'
                        ),
-               );
-       }
-
-       /**
-        * @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'
                );
        }
 
diff --git a/api/ApiAbuseFilterCheckSyntax.php 
b/api/ApiAbuseFilterCheckSyntax.php
index d9fac8f..dfb8274 100644
--- a/api/ApiAbuseFilterCheckSyntax.php
+++ b/api/ApiAbuseFilterCheckSyntax.php
@@ -38,34 +38,6 @@
        }
 
        /**
-        * @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()
         */
        protected function getExamplesMessages() {
diff --git a/api/ApiAbuseFilterEvalExpression.php 
b/api/ApiAbuseFilterEvalExpression.php
index a664df1..75ccc13 100644
--- a/api/ApiAbuseFilterEvalExpression.php
+++ b/api/ApiAbuseFilterEvalExpression.php
@@ -18,33 +18,6 @@
        }
 
        /**
-        * @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()
         */
        protected function getExamplesMessages() {
diff --git a/api/ApiAbuseFilterUnblockAutopromote.php 
b/api/ApiAbuseFilterUnblockAutopromote.php
index 6b3cb17..8155747 100644
--- a/api/ApiAbuseFilterUnblockAutopromote.php
+++ b/api/ApiAbuseFilterUnblockAutopromote.php
@@ -46,38 +46,8 @@
                );
        }
 
-       /**
-        * @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\\"
-               );
        }
 
        /**
diff --git a/api/ApiQueryAbuseFilters.php b/api/ApiQueryAbuseFilters.php
index ac71229..239ea41 100644
--- a/api/ApiQueryAbuseFilters.php
+++ b/api/ApiQueryAbuseFilters.php
@@ -151,11 +151,7 @@
                                }
                        }
                }
-               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 @@
                                        '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,
@@ -211,37 +204,6 @@
                                ),
                                ApiBase::PARAM_ISMULTI => true
                        )
-               );
-       }
-
-       /**
-        * @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'
                );
        }
 
diff --git a/api/ApiQueryAbuseLog.php b/api/ApiQueryAbuseLog.php
index 16e3747..c7fb112 100644
--- a/api/ApiQueryAbuseLog.php
+++ b/api/ApiQueryAbuseLog.php
@@ -232,11 +232,7 @@
                                }
                        }
                }
-               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 @@
                                        '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,
@@ -287,39 +280,6 @@
                                ),
                                ApiBase::PARAM_ISMULTI => true
                        )
-               );
-       }
-
-       /**
-        * @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'
                );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/311772
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f968be3b7ef7cbc7193c8e103beb36ecf9c7b60
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: Anomie <bjor...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to