Jeroen De Dauw has submitted this change and it was merged.
Change subject: Remove b/c for "label" as ChangeOpsMerge ignore conflicts
......................................................................
Remove b/c for "label" as ChangeOpsMerge ignore conflicts
No longer used by any caller, API has been adopted (see
c01d3ee7de75).
Change-Id: Ia21e620a80b55db0934960856022c3b1bc03e6a9
---
M repo/includes/ChangeOp/ChangeOpsMerge.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpsMergeTest.php
2 files changed, 12 insertions(+), 18 deletions(-)
Approvals:
Jeroen De Dauw: Looks good to me, approved
diff --git a/repo/includes/ChangeOp/ChangeOpsMerge.php
b/repo/includes/ChangeOp/ChangeOpsMerge.php
index 4015a76..2fb0f3b 100644
--- a/repo/includes/ChangeOp/ChangeOpsMerge.php
+++ b/repo/includes/ChangeOp/ChangeOpsMerge.php
@@ -73,7 +73,7 @@
* @param Item $fromItem
* @param Item $toItem
* @param string[] $ignoreConflicts list of elements to ignore
conflicts for
- * can only contain 'label' and or 'description' and or
'sitelink'
+ * can only contain 'description' and or 'sitelink'
* @param EntityConstraintProvider $constraintProvider
* @param ChangeOpFactoryProvider $changeOpFactoryProvider
* @param SiteLookup $siteLookup
@@ -104,19 +104,14 @@
}
/**
- * @param array $ignoreConflicts can contain strings 'label',
'description', 'sitelink'
+ * @param string[] $ignoreConflicts can contain strings 'description'
or 'sitelink'
*
* @throws InvalidArgumentException
*/
- private function assertValidIgnoreConflictValues( $ignoreConflicts ) {
- if ( !is_array( $ignoreConflicts ) ) {
- throw new InvalidArgumentException( '$ignoreConflicts
must be an array' );
- }
-
- //TODO remove the adition of 'label' below. This was added to
allow a soft deprecation 11-12-14
- if ( array_diff( $ignoreConflicts, array_merge(
self::$conflictTypes, array( 'label' ) ) ) ) {
+ private function assertValidIgnoreConflictValues( array
$ignoreConflicts ) {
+ if ( array_diff( $ignoreConflicts, self::$conflictTypes ) ) {
throw new InvalidArgumentException(
- '$ignoreConflicts array can only contain
"label", "description" and or "sitelink" values'
+ '$ignoreConflicts array can only contain
"description" and or "sitelink" values'
);
}
}
diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpsMergeTest.php
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpsMergeTest.php
index f352def..074e593 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpsMergeTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpsMergeTest.php
@@ -112,10 +112,9 @@
$to = $this->newItemWithId( 'Q222' );
return array(
array( $from, $to, array() ),
- array( $from, $to, array( 'label' ) ),
+ array( $from, $to, array( 'sitelink' ) ),
array( $from, $to, array( 'description' ) ),
- array( $from, $to, array( 'description', 'label' ) ),
- array( $from, $to, array( 'description', 'label',
'sitelink' ) ),
+ array( $from, $to, array( 'description', 'sitelink' ) ),
);
}
@@ -135,8 +134,9 @@
$from = $this->newItemWithId( 'Q111' );
$to = $this->newItemWithId( 'Q222' );
return array(
+ array( $from, $to, array( 'label' ) ),
array( $from, $to, array( 'foo' ) ),
- array( $from, $to, array( 'label', 'foo' ) ),
+ array( $from, $to, array( 'description', 'foo' ) ),
);
}
@@ -210,12 +210,11 @@
$itemWithLabelAndAlias->getFingerprint()->setLabel( 'en', 'bar'
);
$itemWithLabelAndAlias->getFingerprint()->setAliasGroup( 'en',
array( 'foo' ) );
- $testCases['ignoreConflictLabelMerge'] = array(
+ $testCases['labelAsAliasMerge'] = array(
$itemWithEnLabel->copy(),
$itemWithEnBarLabel->copy(),
new Item(),
- $itemWithLabelAndAlias->copy(),
- array( 'label' )
+ $itemWithLabelAndAlias->copy()
);
$itemWithDescription = new Item();
@@ -372,7 +371,7 @@
$smallerItem->copy(),
$smallerMergedItem->copy(),
$bigMergedItem->copy(),
- array( 'label', 'description', 'sitelink' )
+ array( 'description', 'sitelink' )
);
return $testCases;
}
--
To view, visit https://gerrit.wikimedia.org/r/206077
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia21e620a80b55db0934960856022c3b1bc03e6a9
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits