Tobias Gritschacher has uploaded a new change for review.
https://gerrit.wikimedia.org/r/76727
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
D repo/includes/api/IAutocomment.php
3 files changed, 0 insertions(+), 127 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/27/76727/1
diff --git a/repo/Wikibase.classes.php b/repo/Wikibase.classes.php
index cd9e0b0..14c3bd6 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/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 );
-
-}
--
To view, visit https://gerrit.wikimedia.org/r/76727
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I28b6ade785c7bad3ad63eedb210b397b18b9bf73
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits