Anomie has uploaded a new change for review.

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

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: I9e43a198204737b8142ca8bef85fe7b4c43fa3ac
---
M api/ApiCodeDiff.php
M api/ApiCodeUpdate.php
M api/ApiQueryCodeComments.php
M api/ApiQueryCodePaths.php
M api/ApiQueryCodeRevisions.php
M api/ApiQueryCodeTags.php
M api/ApiRevisionUpdate.php
7 files changed, 4 insertions(+), 227 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeReview 
refs/changes/78/311778/1

diff --git a/api/ApiCodeDiff.php b/api/ApiCodeDiff.php
index ed77b63..dbe9ee7 100644
--- a/api/ApiCodeDiff.php
+++ b/api/ApiCodeDiff.php
@@ -73,32 +73,6 @@
        }
 
        /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getParamDescription() {
-               return array(
-                       'repo' => 'Name of repository to look at',
-                       'rev' => 'Revision ID to fetch diff of' );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getDescription() {
-               return array(
-                       'Fetch formatted diff from CodeReview\'s backing 
revision control system.' );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getExamples() {
-               return array(
-                       'api.php?action=codediff&repo=MediaWiki&rev=42080',
-               );
-       }
-
-       /**
         * @see ApiBase::getExamplesMessages()
         */
        protected function getExamplesMessages() {
diff --git a/api/ApiCodeUpdate.php b/api/ApiCodeUpdate.php
index 4254725..9a6042a 100644
--- a/api/ApiCodeUpdate.php
+++ b/api/ApiCodeUpdate.php
@@ -98,32 +98,6 @@
        }
 
        /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getParamDescription() {
-               return array(
-                       'repo' => 'Name of repository to update',
-                       'rev' => 'Revision ID number to update to' );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getDescription() {
-               return array(
-                       'Update CodeReview repository data from master revision 
control system.' );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getExamples() {
-               return array(
-                       'api.php?action=codeupdate&repo=MediaWiki&rev=42080',
-               );
-       }
-
-       /**
         * @see ApiBase::getExamplesMessages()
         */
        protected function getExamplesMessages() {
diff --git a/api/ApiQueryCodeComments.php b/api/ApiQueryCodeComments.php
index 64184d9..8ffc445 100644
--- a/api/ApiQueryCodeComments.php
+++ b/api/ApiQueryCodeComments.php
@@ -93,11 +93,7 @@
                        $item['status'] = $row->cr_status;
                }
                if ( isset( $this->props['text'] ) ) {
-                       if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                               ApiResult::setContentValue( $item, 'text', 
$row->cc_text );
-                       } else {
-                               ApiResult::setContent( $item, $row->cc_text );
-                       }
+                       ApiResult::setContentValue( $item, 'text', 
$row->cc_text );
                }
                return $item;
        }
@@ -130,35 +126,6 @@
                                        'revision',
                                ),
                        ),
-               );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getParamDescription() {
-               return array(
-                       'repo' => 'Name of the repository',
-                       'limit' => 'How many comments to return',
-                       'start' => 'Timestamp to start listing at',
-                       'prop' => 'Which properties to return. revision is a 
deprecated alias for status',
-               );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getDescription() {
-               return 'List comments on revisions in CodeReview.';
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getExamples() {
-               return array(
-                       
'api.php?action=query&list=codecomments&ccrepo=MediaWiki',
-                       
'api.php?action=query&list=codecomments&ccrepo=MediaWiki&ccprop=timestamp|user|status|text',
                );
        }
 
diff --git a/api/ApiQueryCodePaths.php b/api/ApiQueryCodePaths.php
index 917fdcb..e26e358 100644
--- a/api/ApiQueryCodePaths.php
+++ b/api/ApiQueryCodePaths.php
@@ -54,11 +54,7 @@
 
                foreach ( $res as $row ) {
                        $item = array();
-                       if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                               ApiResult::setContentValue( $item, 'path', 
$row->cp_path );
-                       } else {
-                               ApiResult::setContent( $item, $row->cp_path );
-                       }
+                       ApiResult::setContentValue( $item, 'path', 
$row->cp_path );
                        $data[] = $item;
                }
 
@@ -76,32 +72,6 @@
                                ApiBase::PARAM_TYPE => 'string',
                                ApiBase::PARAM_REQUIRED => true,
                        ),
-               );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getParamDescription() {
-               return array(
-                       'repo' => 'Name of the repository',
-                       'path' => 'Path prefix to filter on',
-               );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getDescription() {
-               return 'Get a list of 10 paths in a given repository, based on 
the input path prefix.';
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getExamples() {
-               return array(
-                       
'api.php?action=query&list=codepaths&cprepo=MediaWiki&cppath=/trunk/phase3',
                );
        }
 
diff --git a/api/ApiQueryCodeRevisions.php b/api/ApiQueryCodeRevisions.php
index 6d6edec..66cfed3 100644
--- a/api/ApiQueryCodeRevisions.php
+++ b/api/ApiQueryCodeRevisions.php
@@ -119,11 +119,7 @@
                        $item['path'] = $row->cr_path;
                }
                if ( isset( $this->props['message'] ) ) {
-                       if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                               ApiResult::setContentValue( $item, 'message', 
$row->cr_message );
-                       } else {
-                               ApiResult::setContent( $item, $row->cr_message 
);
-                       }
+                       ApiResult::setContentValue( $item, 'message', 
$row->cr_message );
                }
                if ( isset( $this->props['author'] ) ) {
                        $item['author'] = $row->cr_author;
@@ -168,11 +164,7 @@
                                'timestamp' => wfTimestamp( TS_ISO_8601, 
$ref->cr_timestamp ),
                                'author' => $ref->cr_author ,
                        );
-                       if ( defined( 'ApiResult::META_CONTENT' ) ) {
-                               ApiResult::setContentValue( $refItem, 
'message', $ref->cr_message );
-                       } else {
-                               ApiResult::setContent( $refItem, 
$ref->cr_message );
-                       }
+                       ApiResult::setContentValue( $refItem, 'message', 
$ref->cr_message );
 
                        $items[] = $refItem;
                }
@@ -217,38 +209,6 @@
                                        'followedup',
                                ),
                        ),
-               );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getParamDescription() {
-               $p = $this->getModulePrefix();
-               return array(
-                       'repo' => 'Name of the repository',
-                       'limit' => 'How many revisions to return',
-                       'path' => 'Only show revisions in these path(s)',
-                       'start' => 'Timestamp to start listing at',
-                       'revs' => "List of revisions to get information about. 
Overrides {$p}start",
-                       'prop' => 'Which properties to return',
-               );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getDescription() {
-               return 'List revisions in CodeReview.';
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getExamples() {
-               return array(
-                       
'api.php?action=query&list=coderevisions&crrepo=MediaWiki',
-                       
'api.php?action=query&list=coderevisions&crrepo=MediaWiki&crprop=revid|author|status|timestamp|tags',
                );
        }
 
diff --git a/api/ApiQueryCodeTags.php b/api/ApiQueryCodeTags.php
index 5754fa5..cf9cb1d 100644
--- a/api/ApiQueryCodeTags.php
+++ b/api/ApiQueryCodeTags.php
@@ -59,31 +59,6 @@
        }
 
        /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getParamDescription() {
-               return array(
-                       'repo' => 'Name of the repository',
-               );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getDescription() {
-               return 'Get a list of tags applied to revisions in a given 
repository.';
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getExamples() {
-               return array(
-                       'api.php?action=query&list=codetags&ctrepo=MediaWiki',
-               );
-       }
-
-       /**
         * @see ApiBase::getExamplesMessages()
         */
        protected function getExamplesMessages() {
diff --git a/api/ApiRevisionUpdate.php b/api/ApiRevisionUpdate.php
index adf91f2..fe5c4d3 100644
--- a/api/ApiRevisionUpdate.php
+++ b/api/ApiRevisionUpdate.php
@@ -103,10 +103,6 @@
                return 'csrf';
        }
 
-       public function getTokenSalt() {
-               return '';
-       }
-
        public function getAllowedParams() {
                $flags = CodeRevision::getPossibleFlags();
                return array(
@@ -158,45 +154,6 @@
                                ApiBase::PARAM_ISMULTI => true,
                        ),
                        'token' => null,
-               );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getParamDescription() {
-               return array(
-                       'repo' => 'Name of repository',
-                       'rev' => 'Revision ID number',
-                       'comment' => 'Comment to add to the revision',
-                       'status' => 'Status to set the revision to',
-                       'addtags' => 'Tags to be added to the revision',
-                       'removetags' => 'Tags to be removed from the revision',
-                       'addflags' => 'Code Signoff flags to assign to the 
revision by the current user',
-                       'removeflags' => 'Code Signoff flags to strike from the 
revision by the current user',
-                       'addreferences' => 'Add references to this revision',
-                       'removereferences' => 'Remove references from this 
revision',
-                       'addreferenced' => 'Add referenced revisions from this 
revision',
-                       'removereferenced' => 'Remove referenced revisions from 
this revision',
-                       'token' => 'Edit token. You can get one of these 
through prop=info.' ,
-               );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getDescription() {
-               return array(
-                       'Submit comments, new status and tags to a revision.'
-               );
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getExamples() {
-               return array(
-                       
'api.php?action=coderevisionupdate&repo=MediaWiki&rev=1&status=fixme',
                );
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e43a198204737b8142ca8bef85fe7b4c43fa3ac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeReview
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