jenkins-bot has submitted this change and it was merged.
Change subject: Get rid of unused Autocomment code
......................................................................
Get rid of unused Autocomment code
Change-Id: I28b6ade785c7bad3ad63eedb210b397b18b9bf73
---
M repo/Wikibase.classes.php
M repo/includes/Autocomment.php
M repo/includes/api/EditEntity.php
D repo/includes/api/IAutocomment.php
M repo/includes/api/ModifyLangAttribute.php
M repo/includes/api/RemoveClaims.php
M repo/includes/api/SetAliases.php
M repo/includes/api/SetSiteLink.php
8 files changed, 0 insertions(+), 135 deletions(-)
Approvals:
Addshore: Looks good to me, approved
jenkins-bot: Verified
diff --git a/repo/Wikibase.classes.php b/repo/Wikibase.classes.php
index 3bc9689..f9dd4fd 100644
--- a/repo/Wikibase.classes.php
+++ b/repo/Wikibase.classes.php
@@ -75,7 +75,6 @@
// includes/api
'Wikibase\Api\ApiWikibase' => 'includes/api/ApiWikibase.php',
- 'Wikibase\Api\IAutocomment' => 'includes/api/IAutocomment.php',
'Wikibase\Api\ItemByTitleHelper' =>
'includes/api/ItemByTitleHelper.php',
'Wikibase\Api\EditEntity' => 'includes/api/EditEntity.php',
'Wikibase\Api\GetEntities' => 'includes/api/GetEntities.php',
diff --git a/repo/includes/Autocomment.php b/repo/includes/Autocomment.php
index c128e6c..54cebef 100644
--- a/repo/includes/Autocomment.php
+++ b/repo/includes/Autocomment.php
@@ -182,50 +182,4 @@
);
return $common;
}
-
- /**
- * Build the summary by call to the module
- *
- * If this is used for other classes than api modules it could be
necessary to change
- * its internal logic
- *
- * @since 0.1
- *
- * @param \Wikibase\Api\IAutocomment $module an api module that support
IAutocomment
- *
- * @param null|array $params
- * @param null|EntityContent $entityContent
- * @return string to be used for the summary
- */
- public static function buildApiSummary( $module, $params = null,
$entityContent = null ) {
- // check if we must pull in the request params
- if ( !isset( $params ) ) {
- $params = $module->extractRequestParams();
- }
-
- // Is there a user supplied summary, then use it but get the
hits first
- if ( isset( $params['summary'] ) ) {
- list( $hits, $summary, $lang ) =
$module->getTextForSummary( $params );
- $summary = $params['summary'];
- }
-
- // otherwise try to construct something
- else {
- list( $hits, $summary, $lang ) =
$module->getTextForSummary( $params );
- if ( !is_string( $summary ) ) {
- if ( isset( $entityContent ) ) {
- $summary =
$entityContent->getTextForSummary( $params );
- }
- else {
- $summary = '';
- }
- }
- }
-
- // Comments are newer user supplied
- $comment = $module->getTextForComment( $params, $hits );
-
- // format the overall string and return it
- return self::formatTotalSummary( $comment, $summary, $lang );
- }
}
diff --git a/repo/includes/api/EditEntity.php b/repo/includes/api/EditEntity.php
index 98ea065..e3ea4c2 100644
--- a/repo/includes/api/EditEntity.php
+++ b/repo/includes/api/EditEntity.php
@@ -16,7 +16,6 @@
use Wikibase\Item;
use Wikibase\Property;
use Wikibase\QueryContent;
-use Wikibase\Autocomment;
use Wikibase\Utils;
/**
diff --git a/repo/includes/api/IAutocomment.php
b/repo/includes/api/IAutocomment.php
deleted file mode 100644
index 2b07b41..0000000
--- a/repo/includes/api/IAutocomment.php
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-
-namespace Wikibase\Api;
-
-/**
- * IAutocomment interface. All Api modules that need autocomments
- * should either extend this directly or by subclassing. Note that
- * the generated content must still be properly delivered to
- * EditEntity::attemptedSave or any similar call.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @since 0.2
- *
- * @file
- * @ingroup WikibaseRepo
- *
- * @licence GNU GPL v2+
- * @author John Erling Blad < [email protected] >
- *
- * @deprecated use the Summary class to build summaries instead
- */
-interface IAutocomment {
-
- /**
- * Make a string for an autocomment, that can be replaced through
system messages.
- *
- * The autocomment is the initial part of the total summary. It is used
to
- * explain the overall purpose with the change. If its later replaced
by a
- * system message then it should not use any user supplied text as arg.
- *
- * The method is not really part of a public interface but is used to
enforce
- * similarity in the code inside the Api modules.
- *
- * @since 0.2
- *
- * @param $params array with parameters from the call to the module
- * @param $plural integer|string the number used for plural forms
- * @return string that can be used as an autocomment
- */
- public function getTextForComment( array $params, $plural = 'none' );
-
- /**
- * Make a string for an autosummary, that can be replaced through
system messages.
- *
- * The autosummary is the final part of the total summary. This call is
used if there
- * is no ordinary summary. If this call fails an autosummary from the
entity itself will
- * be used.
- *
- * The returned array has a count that can be used for plural forms in
the messages,
- * but exact interpretation is somewhat undefined.
- *
- * The language and direction is not passed on and the string should be
wrapped
- * in dir="auto". It is possible to create hints about the string, but
it seems to
- * create more problems than it solves.
- *
- * The method is not really part of a public interface but is used to
enforce
- * similarity in the code inside the Api modules.
- *
- * @since 0.2
- *
- * @param $params array with parameters from the call to the module
- * @return array where the array( int, false|string ) is a count and a
string that can be used as an autosummary
- */
- public function getTextForSummary( array $params );
-
-}
diff --git a/repo/includes/api/ModifyLangAttribute.php
b/repo/includes/api/ModifyLangAttribute.php
index 86160e3..f632b63 100644
--- a/repo/includes/api/ModifyLangAttribute.php
+++ b/repo/includes/api/ModifyLangAttribute.php
@@ -3,8 +3,6 @@
namespace Wikibase\Api;
use ApiBase, Language;
-
-use Wikibase\Autocomment;
use Wikibase\Utils;
/**
diff --git a/repo/includes/api/RemoveClaims.php
b/repo/includes/api/RemoveClaims.php
index 70c45d7..8a8ef93 100644
--- a/repo/includes/api/RemoveClaims.php
+++ b/repo/includes/api/RemoveClaims.php
@@ -6,8 +6,6 @@
use ApiBase, ApiMain;
use MWException;
-
-use Wikibase\Autocomment;
use Wikibase\EntityId;
use Wikibase\Entity;
use Wikibase\Repo\WikibaseRepo;
diff --git a/repo/includes/api/SetAliases.php b/repo/includes/api/SetAliases.php
index 9f6e934..9232c42 100644
--- a/repo/includes/api/SetAliases.php
+++ b/repo/includes/api/SetAliases.php
@@ -3,11 +3,9 @@
namespace Wikibase\Api;
use Wikibase\ChangeOps;
-
use ApiBase, User, Language;
use Wikibase\Entity;
use Wikibase\EntityContent;
-use Wikibase\Autocomment;
use Wikibase\Utils;
use Wikibase\ChangeOpAliases;
diff --git a/repo/includes/api/SetSiteLink.php
b/repo/includes/api/SetSiteLink.php
index 40fe963..7120451 100644
--- a/repo/includes/api/SetSiteLink.php
+++ b/repo/includes/api/SetSiteLink.php
@@ -9,7 +9,6 @@
use Wikibase\EntityContent;
use Wikibase\ItemContent;
use Wikibase\SiteLink;
-use Wikibase\Autocomment;
use Wikibase\Utils;
/**
--
To view, visit https://gerrit.wikimedia.org/r/76727
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I28b6ade785c7bad3ad63eedb210b397b18b9bf73
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits