Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Use CallbackComparers for ClaimDiffer construction
......................................................................

Use CallbackComparers for ClaimDiffer construction

Change-Id: Ida96663d24bcf3250dbbe9dae5aebf4453350e8d
---
M lib/includes/ClaimDiffer.php
M repo/includes/EntityContentDiffView.php
M repo/includes/actions/EditEntityAction.php
M repo/includes/api/SetClaim.php
M repo/tests/phpunit/includes/ClaimSummaryBuilderTest.php
5 files changed, 11 insertions(+), 57 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/23/86423/1

diff --git a/lib/includes/ClaimDiffer.php b/lib/includes/ClaimDiffer.php
index c839f32..9a23c38 100644
--- a/lib/includes/ClaimDiffer.php
+++ b/lib/includes/ClaimDiffer.php
@@ -9,25 +9,7 @@
 /**
  * Class for generating a ClaimDifference given two claims.
  *
- * 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.4
- *
- * @file
- * @ingroup WikibaseLib
  *
  * @licence GNU GPL v2+
  * @author Tobias Gritschacher < tobias.gritschac...@wikimedia.de >
diff --git a/repo/includes/EntityContentDiffView.php 
b/repo/includes/EntityContentDiffView.php
index c889e81..fd85512 100644
--- a/repo/includes/EntityContentDiffView.php
+++ b/repo/includes/EntityContentDiffView.php
@@ -2,9 +2,11 @@
 
 namespace Wikibase;
 
+use Diff\Comparer\CallbackComparer;
 use Diff\OrderedListDiffer;
 use Diff\ListDiffer;
-use Content, Html;
+use Content;
+use Html;
 use ValueFormatters\FormatterOptions;
 use ValueFormatters\ValueFormatter;
 use Wikibase\Lib\EntityIdLabelFormatter;
@@ -14,25 +16,7 @@
 /**
  * Difference view for Wikibase entities.
  *
- * 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.1
- *
- * @file
- * @ingroup WikibaseRepo
  *
  * @licence GNU GPL v2+
  * @author Daniel Kinzler
@@ -150,10 +134,10 @@
                        return $old->equals( $new );
                };
 
-               // TODO: deep inject the EntityDiffVisualizer
+               // TODO: derp inject the EntityDiffVisualizer
                $diffVisualizer = new EntityDiffVisualizer(
                        $this->getContext(),
-                       new ClaimDiffer( new OrderedListDiffer( $comparer ) ),
+                       new ClaimDiffer( new OrderedListDiffer( new 
CallbackComparer( $comparer ) ) ),
                        new ClaimDifferenceVisualizer(
                                $this->propertyNameFormatter,
                                $this->snakValueFormatter
diff --git a/repo/includes/actions/EditEntityAction.php 
b/repo/includes/actions/EditEntityAction.php
index 7389d80..0846193 100644
--- a/repo/includes/actions/EditEntityAction.php
+++ b/repo/includes/actions/EditEntityAction.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase;
 
+use Diff\Comparer\CallbackComparer;
 use Diff\OrderedListDiffer;
 use Html, Linker, Skin, Status, Revision;
 use ValueFormatters\FormatterOptions;
@@ -458,7 +459,7 @@
                // TODO: deep inject the EntityDiffVisualizer
                $diffVisualizer = new EntityDiffVisualizer(
                        $this->getContext(),
-                       new ClaimDiffer( new OrderedListDiffer( $comparer ) ),
+                       new ClaimDiffer( new OrderedListDiffer( new 
CallbackComparer( $comparer ) ) ),
                        new ClaimDifferenceVisualizer(
                                $this->propertyNameFormatter,
                                $this->snakValueFormatter
diff --git a/repo/includes/api/SetClaim.php b/repo/includes/api/SetClaim.php
index af91f03..b5bf991 100644
--- a/repo/includes/api/SetClaim.php
+++ b/repo/includes/api/SetClaim.php
@@ -4,6 +4,7 @@
 
 use DataValues\IllegalValueException;
 use ApiMain;
+use Diff\Comparer\CallbackComparer;
 use Diff\OrderedListDiffer;
 use MWException;
 use ApiBase;
@@ -23,21 +24,6 @@
 
 /**
  * API module for creating or updating an entire Claim.
- *
- * 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.4
  *
@@ -87,7 +73,7 @@
                        return $old->equals( $new );
                };
 
-               $claimDiffer = new ClaimDiffer( new OrderedListDiffer( 
$comparer ) );
+               $claimDiffer = new ClaimDiffer( new OrderedListDiffer( new 
CallbackComparer( $comparer ) ) );
 
                $options = new FormatterOptions( array(
                        //TODO: fallback chain
diff --git a/repo/tests/phpunit/includes/ClaimSummaryBuilderTest.php 
b/repo/tests/phpunit/includes/ClaimSummaryBuilderTest.php
index b76ffdf..677e4ea 100644
--- a/repo/tests/phpunit/includes/ClaimSummaryBuilderTest.php
+++ b/repo/tests/phpunit/includes/ClaimSummaryBuilderTest.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase\Test;
 
+use Diff\Comparer\CallbackComparer;
 use Diff\OrderedListDiffer;
 use Diff\ListDiffer;
 use Wikibase\ClaimDiffer;
@@ -154,7 +155,7 @@
 
                $claimSummaryBuilder = new ClaimSummaryBuilder(
                        'wbsetclaim',
-                       new ClaimDiffer( new OrderedListDiffer( $comparer ) ),
+                       new ClaimDiffer( new OrderedListDiffer( new 
CallbackComparer( $comparer ) ) ),
                        $snakFormatter
                );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida96663d24bcf3250dbbe9dae5aebf4453350e8d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com>

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

Reply via email to