Jeroen De Dauw has uploaded a new change for review.

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

Change subject: Some cleanup in ClaimDiffer
......................................................................

Some cleanup in ClaimDiffer

Change-Id: Ieb255d32ef2af57cb6af52dc824faae0e045c433
---
M repo/includes/ClaimDiffer.php
1 file changed, 15 insertions(+), 27 deletions(-)


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

diff --git a/repo/includes/ClaimDiffer.php b/repo/includes/ClaimDiffer.php
index 1577f0b..0a11777 100644
--- a/repo/includes/ClaimDiffer.php
+++ b/repo/includes/ClaimDiffer.php
@@ -2,9 +2,9 @@
 
 namespace Wikibase;
 
-use Diff\Diff;
-use Diff\Differ;
-use Diff\DiffOpChange;
+use Diff\DiffOp\Diff\Diff;
+use Diff\Differ\Differ;
+use Diff\DiffOp\DiffOpChange;
 use Wikibase\DataModel\Internal\ObjectComparer;
 
 /**
@@ -18,20 +18,8 @@
  */
 class ClaimDiffer {
 
-       /**
-        * @since 0.4
-        *
-        * @var Differ
-        */
        private $listDiffer;
 
-       /**
-        * Constructor.
-        *
-        * @since 0.4
-        *
-        * @param Differ $listDiffer
-        */
        public function __construct( Differ $listDiffer ) {
                $this->listDiffer = $listDiffer;
        }
@@ -62,12 +50,12 @@
        }
 
        /**
-        * @param Claim $oldClaim
-        * @param Claim $newClaim
+        * @param Claim|null $oldClaim
+        * @param Claim|null $newClaim
         *
         * @return DiffOpChange|null
         */
-       private function diffMainSnaks( $oldClaim, $newClaim ) {
+       private function diffMainSnaks( Claim $oldClaim = null, Claim $newClaim 
= null ) {
                $oldClaimMainSnak = $oldClaim === null ? null : 
$oldClaim->getMainSnak();
                $newClaimMainSnak = $newClaim === null ? null : 
$newClaim->getMainSnak();
 
@@ -79,12 +67,12 @@
        }
 
        /**
-        * @param Claim $oldClaim
-        * @param Claim $newClaim
+        * @param Claim|null $oldClaim
+        * @param Claim|null $newClaim
         *
         * @return Diff
         */
-       private function diffQualifiers( $oldClaim, $newClaim ) {
+       private function diffQualifiers( Claim $oldClaim = null, Claim 
$newClaim = null ) {
                $oldQualifiers = $oldClaim === null ? array() : 
iterator_to_array( $oldClaim->getQualifiers() );
                $newQualifiers = $newClaim === null ? array() : 
iterator_to_array( $newClaim->getQualifiers() );
 
@@ -96,12 +84,12 @@
        }
 
        /**
-        * @param Statement $oldClaim
-        * @param Statement $newClaim
+        * @param Statement|null $oldClaim
+        * @param Statement|null $newClaim
         *
         * @return DiffOpChange|null
         */
-       private function diffRank( $oldClaim, $newClaim ) {
+       private function diffRank( Statement $oldClaim = null, Statement 
$newClaim = null ) {
                $oldRank = $oldClaim === null ? null : $oldClaim->getRank();
                $newRank = $newClaim === null ? null : $newClaim->getRank();
 
@@ -113,12 +101,12 @@
        }
 
        /**
-        * @param Statement $oldClaim
-        * @param Statement $newClaim
+        * @param Statement|null $oldClaim
+        * @param Statement|null $newClaim
         *
         * @return Diff
         */
-       private function diffReferences( $oldClaim, $newClaim ) {
+       private function diffReferences( Statement $oldClaim = null, Statement 
$newClaim = null ) {
                $oldReferences = $oldClaim === null ? array() : 
iterator_to_array( $oldClaim->getReferences() );
                $newReferences = $newClaim === null ? array() : 
iterator_to_array( $newClaim->getReferences() );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb255d32ef2af57cb6af52dc824faae0e045c433
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